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` ### `tailwindCSS.colorDecorators`
Controls whether the editor should render inline color decorators for Tailwind CSS classes and helper functions. Controls whether the editor should render inline color decorators for Tailwind CSS classes and helper functions. **Default: `true`**
- `inherit`: Color decorators are rendered if `editor.colorDecorators` is enabled.
- `on`: Color decorators are rendered.
- `off`: Color decorators are not rendered.
### `tailwindCSS.showPixelEquivalents` ### `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\"}`" "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": { "tailwindCSS.colorDecorators": {
"type": "string", "type": "boolean",
"enum": [ "default": true,
"inherit",
"on",
"off"
],
"markdownEnumDescriptions": [
"Color decorators are rendered if `editor.colorDecorators` is enabled.",
"Color decorators are rendered.",
"Color decorators are not rendered."
],
"default": "inherit",
"markdownDescription": "Controls whether the editor should render inline color decorators for Tailwind CSS classes and helper functions.", "markdownDescription": "Controls whether the editor should render inline color decorators for Tailwind CSS classes and helper functions.",
"scope": "language-overridable" "scope": "language-overridable"
}, },

View File

@ -18,7 +18,7 @@ export async function getDocumentColors(
if (!state.enabled) return colors if (!state.enabled) return colors
let settings = await state.editor.getConfiguration(document.uri) 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) let classLists = await findClassListsInDocument(state, document)
classLists.forEach((classList) => { classLists.forEach((classList) => {

View File

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