@@ -11,12 +11,26 @@ file_extensions:
11
11
12
12
variables :
13
13
14
- selector_start : ' [[:alpha:]{{nested_selector_start}}]'
15
- nested_selector_begin : (?={{nested_selector_start}})
16
- nested_selector_start : ' [.:#&*\[{{combinator_char}}]'
14
+ # Properties and Selectors
15
+ property_or_selector_begin : (?={{ident_begin}}|{{selector_start}})
16
+ property_end : (?=[;@)}])
17
+
18
+ selector_start : ' [[:alpha:].:#&*\[{{combinator_char}}]'
19
+ selector_end : (?=[;@(){}])
17
20
18
21
contexts :
19
22
23
+ stylesheet :
24
+ # relaxed properties vs. selectors
25
+ - meta_include_prototype : false
26
+ - include : comments
27
+ - include : property-lists
28
+ - include : properties-or-selectors
29
+ - include : at-rules
30
+ - include : rule-terminators
31
+ - include : illegal-commas
32
+ - include : illegal-groups
33
+
20
34
# ##[ CSS AT RULES ]############################################################
21
35
22
36
at-other :
@@ -29,38 +43,58 @@ contexts:
29
43
- include : tailwind-at-screen
30
44
31
45
at-rule-block :
32
- # note: maintain compatibility with various ST4 builds
46
+ # required until ST4174 (PR #3831)
33
47
- match : \{
34
48
scope : punctuation.section.block.begin.css
35
49
push : at-rule-block-body
36
50
37
51
at-rule-block-body :
38
- # note: maintain compatibility with various ST4 builds
52
+ # required until ST4174 (PR #3831)
39
53
- meta_scope : meta.block.css
40
54
- include : block-end2
41
55
- include : stylesheet
42
56
43
57
# ##[ CSS SELECTORS ]###########################################################
44
58
45
- nested-selectors :
46
- # https://drafts.csswg.org/css-nesting-1
47
- - match : ' {{nested_selector_begin}}'
48
- push : selector-body
59
+ properties-or-selectors :
60
+ # required until ST4174 (PR #3898)
61
+ - match : ' {{property_or_selector_begin}}'
62
+ branch_point : property-or-selector
63
+ branch :
64
+ - maybe-property
65
+ - selector-body
66
+
67
+ maybe-property :
68
+ # required until ST4174 (PR #3898)
69
+ - meta_include_prototype : false
70
+ - include : property-end
71
+ - include : property-identifiers
72
+ - match : ' '
73
+ fail : property-or-selector
74
+
75
+ property-end :
76
+ # required until ST4174 (PR #3898)
77
+ - match : ' {{property_end}}'
78
+ pop : 1
49
79
50
80
selector-variables :
81
+ # required until ST4174 (PR #3898)
51
82
- meta_prepend : true
52
83
- match : \&
53
84
scope : variable.language.parent.css
54
85
55
86
# ##[ CSS PROPERTY LISTS ]######################################################
56
87
57
88
property-list-body :
89
+ # relaxed properties vs. selectors
58
90
- meta_scope : meta.property-list.css meta.block.css
59
91
- include : block-end
60
- - include : nested-selectors
61
- - include : at-rules
62
- - include : property-lists
63
- - include : rule-list-body
92
+ - include : stylesheet
93
+
94
+ illegal-commas :
95
+ # required until ST4174 (PR #3831)
96
+ - match : ' ,'
97
+ scope : invalid.illegal.unexpected-token.css
64
98
65
99
# ##[ TAILWIND INLINE AT RULES ]################################################
66
100
0 commit comments