Skip to content

Commit 0e8578d

Browse files
committed
Add syntax highlighting for short form of @variant
1 parent 53081e6 commit 0e8578d

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

packages/vscode-tailwindcss/syntaxes/at-rules.tmLanguage.json

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290
]
291291
},
292292
{
293-
"begin": "(?i)((@)variant)(?=[\\s{]|/\\*|$)",
293+
"begin": "(?i)((@)variant)(?=[\\s{(]|$)",
294294
"beginCaptures": {
295295
"1": {
296296
"name": "keyword.control.at-rule.variant.tailwind"
@@ -299,12 +299,32 @@
299299
"name": "punctuation.definition.keyword.css"
300300
}
301301
},
302-
"end": "(?<=})(?!\\G)",
302+
"end": "(?<=[};])(?!\\G)",
303303
"patterns": [
304304
{
305-
"match": "[^\\s{,]+?",
305+
"match": "[^\\s({;,]+?",
306306
"name": "variable.parameter.variant.tailwind"
307307
},
308+
{
309+
"begin": "[(]",
310+
"beginCaptures": {
311+
"0": {
312+
"name": "punctuation.section.variant.begin.bracket.paren.tailwind"
313+
}
314+
},
315+
"end": "[)]",
316+
"endCaptures": {
317+
"0": {
318+
"name": "punctuation.section.variant.end.bracket.paren.tailwind"
319+
}
320+
},
321+
"name": "meta.selector.tailwind",
322+
"patterns": [
323+
{
324+
"include": "source.css#selector-innards"
325+
}
326+
]
327+
},
308328
{
309329
"begin": "{",
310330
"beginCaptures": {

0 commit comments

Comments
 (0)