Skip to content

Commit e0ef982

Browse files
committed
update colorDecorators setting
1 parent 6aabc3d commit e0ef982

File tree

4 files changed

+5
-19
lines changed

4 files changed

+5
-19
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ Enable completions when using [Emmet](https://emmet.io/)-style syntax, for examp
7474

7575
### `tailwindCSS.colorDecorators`
7676

77-
Controls whether the editor should render inline color decorators for Tailwind CSS classes and helper functions.
78-
79-
- `inherit`: Color decorators are rendered if `editor.colorDecorators` is enabled.
80-
- `on`: Color decorators are rendered.
81-
- `off`: Color decorators are not rendered.
77+
Controls whether the editor should render inline color decorators for Tailwind CSS classes and helper functions. **Default: `true`**
8278

8379
### `tailwindCSS.showPixelEquivalents`
8480

package.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,8 @@
7878
"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\"}`"
7979
},
8080
"tailwindCSS.colorDecorators": {
81-
"type": "string",
82-
"enum": [
83-
"inherit",
84-
"on",
85-
"off"
86-
],
87-
"markdownEnumDescriptions": [
88-
"Color decorators are rendered if `editor.colorDecorators` is enabled.",
89-
"Color decorators are rendered.",
90-
"Color decorators are not rendered."
91-
],
92-
"default": "inherit",
81+
"type": "boolean",
82+
"default": true,
9383
"markdownDescription": "Controls whether the editor should render inline color decorators for Tailwind CSS classes and helper functions.",
9484
"scope": "language-overridable"
9585
},

packages/tailwindcss-language-service/src/documentColorProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export async function getDocumentColors(
1818
if (!state.enabled) return colors
1919

2020
let settings = await state.editor.getConfiguration(document.uri)
21-
if (settings.colorDecorators === 'off') return colors
21+
if (settings.colorDecorators === false) return colors
2222

2323
let classLists = await findClassListsInDocument(state, document)
2424
classLists.forEach((classList) => {

packages/tailwindcss-language-service/src/util/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export type Settings = {
3737
validate: boolean
3838
showPixelEquivalents: boolean
3939
rootFontSize: number
40-
colorDecorators: 'inherit' | 'on' | 'off'
40+
colorDecorators: boolean
4141
lint: {
4242
cssConflict: DiagnosticSeveritySetting
4343
invalidApply: DiagnosticSeveritySetting

0 commit comments

Comments
 (0)