update colorDecorators setting

master
Brad Cornes 2021-05-04 12:17:06 +01:00
parent 6aabc3d9a5
commit e0ef982fd5
4 changed files with 5 additions and 19 deletions

View File

@ -74,11 +74,7 @@ Enable completions when using [Emmet](https://emmet.io/)-style syntax, for examp
### `tailwindCSS.colorDecorators`
Controls whether the editor should render inline color decorators for Tailwind CSS classes and helper functions.
- `inherit`: Color decorators are rendered if `editor.colorDecorators` is enabled.
- `on`: Color decorators are rendered.
- `off`: Color decorators are not rendered.
Controls whether the editor should render inline color decorators for Tailwind CSS classes and helper functions. **Default: `true`**
### `tailwindCSS.showPixelEquivalents`

View File

@ -78,18 +78,8 @@
"markdownDescription": "Enable features in languages that are not supported by default. Add a mapping here between the new language and an already supported language.\n E.g.: `{\"plaintext\": \"html\"}`"
},
"tailwindCSS.colorDecorators": {
"type": "string",
"enum": [
"inherit",
"on",
"off"
],
"markdownEnumDescriptions": [
"Color decorators are rendered if `editor.colorDecorators` is enabled.",
"Color decorators are rendered.",
"Color decorators are not rendered."
],
"default": "inherit",
"type": "boolean",
"default": true,
"markdownDescription": "Controls whether the editor should render inline color decorators for Tailwind CSS classes and helper functions.",
"scope": "language-overridable"
},

View File

@ -18,7 +18,7 @@ export async function getDocumentColors(
if (!state.enabled) return colors
let settings = await state.editor.getConfiguration(document.uri)
if (settings.colorDecorators === 'off') return colors
if (settings.colorDecorators === false) return colors
let classLists = await findClassListsInDocument(state, document)
classLists.forEach((classList) => {

View File

@ -37,7 +37,7 @@ export type Settings = {
validate: boolean
showPixelEquivalents: boolean
rootFontSize: number
colorDecorators: 'inherit' | 'on' | 'off'
colorDecorators: boolean
lint: {
cssConflict: DiagnosticSeveritySetting
invalidApply: DiagnosticSeveritySetting