Skip to content

Commit 7b1cce1

Browse files
webfilteredDrJKL
andauthored
Add VS Code CSS validation support (#5893)
## Summary Adds VS Code custom CSS data for proper validation of non-standard CSS properties and Tailwind v4 directives. ## Changes - **What**: Custom CSS data files for VS Code CSS language service validation - `app-region` - Electron draggable regions - `speak` - Deprecated aural stylesheet property - `@custom-variant` - Tailwind v4 custom variant definitions - `@utility` - Tailwind v4 custom utility definitions - Fixes broken documentation links in existing Tailwind directive references ## Review Focus Documentation links verified against current Tailwind CSS and Electron documentation. ## Screenshots Current: Yellow squigglies <img width="338" height="179" alt="image" src="https://github.com/user-attachments/assets/652040f5-8e0b-486b-95f6-2fa8f9bf9ba7" /><img width="499" height="180" alt="image" src="https://github.com/user-attachments/assets/43d16210-7fbf-4ef8-b0e1-9a16e59d1d85" /> Proposed: Satisfying lack of warnings <img width="173" height="62" alt="image" src="https://github.com/user-attachments/assets/25f1c1c4-22b7-483b-9848-3030a3c0dc86" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5893-Add-VS-Code-CSS-validation-support-2806d73d3650813fb5f1e176360c5b7e) by [Unito](https://www.unito.io) --------- Consequences of `@apply` usage may include but are not limited to: - A strong talking-to - Receipt of a corrective directive missive - Upsetting @DrJKL Co-authored-by: Alexander Brown <[email protected]>
1 parent 39eca0b commit 7b1cce1

File tree

4 files changed

+81
-9
lines changed

4 files changed

+81
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ CLAUDE.local.md
3131
*.code-workspace
3232
!.vscode/extensions.json
3333
!.vscode/tailwind.json
34+
!.vscode/custom-css.json
3435
!.vscode/settings.json.default
3536
!.vscode/launch.json.default
3637
.idea

.vscode/custom-css.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"version": 1.1,
3+
"properties": [
4+
{
5+
"name": "app-region",
6+
"description": "Electron-specific CSS property that defines draggable regions in custom title bar windows. Setting 'drag' marks a rectangular area as draggable for moving the window; 'no-drag' excludes areas from the draggable region.",
7+
"values": [
8+
{
9+
"name": "drag",
10+
"description": "Marks the element as draggable for moving the Electron window"
11+
},
12+
{
13+
"name": "no-drag",
14+
"description": "Excludes the element from being used to drag the Electron window"
15+
}
16+
],
17+
"references": [
18+
{
19+
"name": "Electron Window Customization",
20+
"url": "https://www.electronjs.org/docs/latest/tutorial/window-customization"
21+
}
22+
]
23+
},
24+
{
25+
"name": "speak",
26+
"description": "Deprecated CSS2 aural stylesheet property for controlling screen reader speech. Use ARIA attributes instead.",
27+
"values": [
28+
{
29+
"name": "auto",
30+
"description": "Content is read aurally if element is not a block and is visible"
31+
},
32+
{
33+
"name": "never",
34+
"description": "Content will not be read aurally"
35+
},
36+
{
37+
"name": "always",
38+
"description": "Content will be read aurally regardless of display settings"
39+
}
40+
],
41+
"references": [
42+
{
43+
"name": "CSS-Tricks Reference",
44+
"url": "https://css-tricks.com/almanac/properties/s/speak/"
45+
}
46+
],
47+
"status": "obsolete"
48+
}
49+
]
50+
}

.vscode/settings.json.default

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"css.customData": [
3-
".vscode/tailwind.json"
3+
".vscode/tailwind.json",
4+
".vscode/custom-css.json"
45
]
56
}

.vscode/tailwind.json

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"references": [
88
{
99
"name": "Tailwind Documentation",
10-
"url": "https://tailwindcss.com/docs/functions-and-directives#import"
10+
"url": "https://tailwindcss.com/docs/functions-and-directives#import-directive"
1111
}
1212
]
1313
},
@@ -17,7 +17,7 @@
1717
"references": [
1818
{
1919
"name": "Tailwind Documentation",
20-
"url": "https://tailwindcss.com/docs/functions-and-directives#theme"
20+
"url": "https://tailwindcss.com/docs/functions-and-directives#theme-directive"
2121
}
2222
]
2323
},
@@ -27,17 +27,17 @@
2727
"references": [
2828
{
2929
"name": "Tailwind Documentation",
30-
"url": "https://tailwindcss.com/docs/functions-and-directives#layer"
30+
"url": "https://tailwindcss.com/docs/theme#layers"
3131
}
3232
]
3333
},
3434
{
3535
"name": "@apply",
36-
"description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
36+
"description": "DO NOT USE. IF YOU ARE CAUGHT USING @apply YOU WILL FACE SEVERE CONSEQUENCES.",
3737
"references": [
3838
{
3939
"name": "Tailwind Documentation",
40-
"url": "https://tailwindcss.com/docs/functions-and-directives#apply"
40+
"url": "https://tailwindcss.com/docs/functions-and-directives#apply-directive"
4141
}
4242
]
4343
},
@@ -47,7 +47,7 @@
4747
"references": [
4848
{
4949
"name": "Tailwind Documentation",
50-
"url": "https://tailwindcss.com/docs/functions-and-directives#config"
50+
"url": "https://tailwindcss.com/docs/functions-and-directives#config-directive"
5151
}
5252
]
5353
},
@@ -57,7 +57,7 @@
5757
"references": [
5858
{
5959
"name": "Tailwind Documentation",
60-
"url": "https://tailwindcss.com/docs/functions-and-directives#reference"
60+
"url": "https://tailwindcss.com/docs/functions-and-directives#reference-directive"
6161
}
6262
]
6363
},
@@ -67,7 +67,27 @@
6767
"references": [
6868
{
6969
"name": "Tailwind Documentation",
70-
"url": "https://tailwindcss.com/docs/functions-and-directives#plugin"
70+
"url": "https://tailwindcss.com/docs/functions-and-directives#plugin-directive"
71+
}
72+
]
73+
},
74+
{
75+
"name": "@custom-variant",
76+
"description": "Use the `@custom-variant` directive to add a custom variant to your project. Custom variants can be used with utilities like `hover`, `focus`, and responsive breakpoints. Use `@slot` inside the variant to indicate where the utility's styles should be inserted.",
77+
"references": [
78+
{
79+
"name": "Tailwind Documentation",
80+
"url": "https://tailwindcss.com/docs/adding-custom-styles#adding-custom-variants"
81+
}
82+
]
83+
},
84+
{
85+
"name": "@utility",
86+
"description": "Use the `@utility` directive to add custom utilities to your project. Custom utilities work with all variants like `hover`, `focus`, and responsive variants. Use `--value()` to create functional utilities that accept arguments.",
87+
"references": [
88+
{
89+
"name": "Tailwind Documentation",
90+
"url": "https://tailwindcss.com/docs/adding-custom-styles#adding-custom-utilities"
7191
}
7292
]
7393
}

0 commit comments

Comments
 (0)