|
5 | 5 |
|
6 | 6 | (sassdoc_block) @comment.doc |
7 | 7 |
|
8 | | -(tag_name) @tag |
9 | | - |
10 | 8 | [ |
| 9 | + (tag_name) |
11 | 10 | (universal_selector) |
12 | 11 | (nesting_selector) |
13 | | -] @character.special |
| 12 | +] @tag |
14 | 13 |
|
15 | 14 | (attribute_selector (plain_value) @string) |
16 | 15 | (parenthesized_query |
|
40 | 39 | ] @operator |
41 | 40 |
|
42 | 41 | ; Scope keyword operators to their parent nodes to avoid |
43 | | -; false matches inside identifiers (e.g. "not" in "annotation"). |
44 | | -; The capture must be placed on the string node itself (inside the |
45 | | -; parentheses) to avoid highlighting the entire parent expression. |
46 | | -[ |
47 | | - (binary_query "and" @keyword.operator) |
48 | | - (binary_query "or" @keyword.operator) |
49 | | - (unary_query "not" @keyword.operator) |
50 | | - (unary_query "only" @keyword.operator) |
51 | | - (style_query "and" @keyword.operator) |
52 | | - (style_query "or" @keyword.operator) |
53 | | - (style_query "not" @keyword.operator) |
54 | | - (scroll_state_query "and" @keyword.operator) |
55 | | - (scroll_state_query "or" @keyword.operator) |
56 | | - (scroll_state_query "not" @keyword.operator) |
57 | | - (if_style_condition "and" @keyword.operator) |
58 | | - (if_style_condition "or" @keyword.operator) |
59 | | - (if_style_condition "not" @keyword.operator) |
60 | | - (binary_expression "and" @keyword.operator) |
61 | | - (binary_expression "or" @keyword.operator) |
62 | | - (unary_expression "not" @keyword.operator) |
63 | | -] |
64 | | - |
65 | | -(pseudo_element_selector "::" (tag_name) @attribute) |
66 | | -(pseudo_class_selector ":" (class_name) @attribute) |
67 | | -(page_pseudo_class) @attribute |
| 42 | +; false matches inside identifiers (e.g. "not" in "annotation") |
| 43 | +[ |
| 44 | + (binary_query "and") |
| 45 | + (binary_query "or") |
| 46 | + (unary_query "not") |
| 47 | + (unary_query "only") |
| 48 | + (style_query "and") |
| 49 | + (style_query "or") |
| 50 | + (style_query "not") |
| 51 | + (scroll_state_query "and") |
| 52 | + (scroll_state_query "or") |
| 53 | + (scroll_state_query "not") |
| 54 | + (if_style_condition "and") |
| 55 | + (if_style_condition "or") |
| 56 | + (if_style_condition "not") |
| 57 | + (binary_expression "and") |
| 58 | + (binary_expression "or") |
| 59 | + (unary_expression "not") |
| 60 | +] @keyword.operator |
| 61 | + |
| 62 | +(pseudo_element_selector "::" (tag_name) @selector.pseudo) |
| 63 | +(pseudo_class_selector ":" (class_name) @selector.pseudo) |
| 64 | +(page_pseudo_class) @selector.pseudo |
68 | 65 |
|
69 | 66 | [ |
70 | 67 | (variable_name) |
71 | 68 | (variable_value) |
72 | | -] @variable |
73 | | - |
74 | | -(container_statement (container_name) @variable) |
| 69 | + (container_statement (container_name)) |
| 70 | +] @variable.other.member |
75 | 71 |
|
76 | 72 | (argument_name) @variable.parameter |
77 | 73 |
|
|
81 | 77 | (property_name) |
82 | 78 | ] @property |
83 | 79 |
|
84 | | -(id_name) @constant |
85 | | -(class_name) @type |
86 | | -(placeholder_name) @type |
87 | | -(namespace_name) @module |
88 | | -(namespace_selector (tag_name) @module "|") |
89 | | -(variable_module (module) @module) |
90 | | -(call_expression module: (module) @module) |
| 80 | +(id_name) @selector.id |
| 81 | +(class_name) @selector.class |
| 82 | +(placeholder_name) @selector.class |
| 83 | +(namespace_name) @namespace |
| 84 | +(namespace_selector (tag_name) @namespace "|") |
| 85 | +(variable_module (module) @namespace) |
91 | 86 |
|
92 | | -(attribute_name) @tag.attribute |
| 87 | +(attribute_name) @attribute |
93 | 88 |
|
94 | 89 | [ |
95 | 90 | (function_name) |
|
101 | 96 |
|
102 | 97 | [ |
103 | 98 | (plain_value) |
| 99 | + (keyframes_name) |
104 | 100 | (keyword_query) |
105 | 101 | (feature_value) |
106 | 102 | ] @constant.builtin |
107 | 103 |
|
108 | | -(keyframes_name) @variable |
109 | | - |
110 | 104 | (interpolation "#{" @punctuation.special "}" @punctuation.special) |
111 | 105 |
|
112 | 106 | [ |
|
133 | 127 | "@extend" |
134 | 128 | "@warn" |
135 | 129 | (at_keyword) |
136 | | - (margin_at_keyword) |
137 | | - (font_feature_value_keyword) |
138 | | -] @keyword.directive |
139 | | - |
140 | | -[ |
141 | 130 | (to) |
142 | 131 | (from) |
143 | | -] @keyword |
144 | | - |
145 | | -[ |
146 | 132 | (important) |
147 | 133 | (default) |
148 | 134 | (global) |
149 | | -] @keyword.modifier |
| 135 | + (margin_at_keyword) |
| 136 | + (font_feature_value_keyword) |
| 137 | +] @keyword |
150 | 138 |
|
151 | 139 | ; Scope bare keyword strings to their parent nodes to avoid |
152 | | -; false matches inside identifiers (e.g. "as" in "ease-out"). |
153 | | -; The capture must be placed on the string node itself (inside the |
154 | | -; parentheses) to avoid highlighting the entire parent clause. |
| 140 | +; false matches inside identifiers (e.g. "as" in "ease-out") |
155 | 141 | [ |
156 | | - (as_clause "as" @keyword) |
157 | | - (with_clause "with" @keyword) |
158 | | - (visibility_clause "hide" @keyword) |
159 | | - (visibility_clause "show" @keyword) |
160 | | -] |
| 142 | + (as_clause "as") |
| 143 | + (with_clause "with") |
| 144 | + (visibility_clause "hide") |
| 145 | + (visibility_clause "show") |
| 146 | +] @keyword |
161 | 147 |
|
162 | 148 | [ |
163 | | - (selector_query "selector" @function.builtin) |
164 | | - (style_query "style" @function.builtin) |
165 | | - (scroll_state_query "scroll-state" @function.builtin) |
166 | | - (font_tech_query "font-tech" @function.builtin) |
167 | | - (font_format_query "font-format" @function.builtin) |
168 | | - (at_rule_query "at-rule" @function.builtin) |
169 | | - (named_feature_query "named-feature" @function.builtin) |
170 | | - (import_layer "layer" @function.builtin) |
171 | | - (import_supports "supports" @function.builtin) |
172 | | - (if_style_condition "style" @function.builtin) |
173 | | - (if_media_condition "media" @function.builtin) |
174 | | - (if_supports_condition "supports" @function.builtin) |
175 | | - (if_sass_condition "sass" @function.builtin) |
176 | | -] |
| 149 | + (selector_query "selector") |
| 150 | + (style_query "style") |
| 151 | + (scroll_state_query "scroll-state") |
| 152 | + (font_tech_query "font-tech") |
| 153 | + (font_format_query "font-format") |
| 154 | + (at_rule_query "at-rule") |
| 155 | + (named_feature_query "named-feature") |
| 156 | + (import_layer "layer") |
| 157 | + (import_supports "supports") |
| 158 | + (if_style_condition "style") |
| 159 | + (if_media_condition "media") |
| 160 | + (if_supports_condition "supports") |
| 161 | + (if_sass_condition "sass") |
| 162 | +] @function.builtin |
177 | 163 |
|
178 | 164 | [ |
179 | | - (if_expression (function_name) @function.builtin) |
180 | | - (attr_expression (function_name) @function.builtin) |
181 | | - (attr_type_function (function_name) @function.builtin) |
182 | | -] |
| 165 | + (if_expression (function_name)) |
| 166 | + (attr_expression (function_name)) |
| 167 | + (attr_type_function (function_name)) |
| 168 | +] @function.builtin |
183 | 169 |
|
184 | 170 | (attr_type (keyword) @keyword) |
185 | 171 | (syntax_type) @type |
186 | | -(if_else_condition) @keyword.conditional |
| 172 | +(if_else_condition) @keyword.control.conditional |
187 | 173 |
|
188 | 174 | (style_condition |
189 | 175 | (property_name) @property) |
|
197 | 183 | "@mixin" |
198 | 184 | ] @keyword.function |
199 | 185 |
|
200 | | -"@return" @keyword.return |
| 186 | +"@return" @keyword.control.return |
201 | 187 |
|
202 | 188 | [ |
203 | 189 | "@else" |
204 | 190 | "@if" |
205 | | -] @keyword.conditional |
206 | | -(else_if_clause "if" @keyword.conditional) |
| 191 | +] @keyword.control.conditional |
| 192 | +(else_if_clause "if" @keyword.control.conditional) |
207 | 193 |
|
208 | 194 | ; Scope loop keywords to their parent nodes |
209 | 195 | [ |
|
220 | 206 | "@import" |
221 | 207 | "@include" |
222 | 208 | "@use" |
223 | | -] @keyword.import |
| 209 | +] @keyword.control.import |
224 | 210 |
|
225 | 211 | ; Custom properties (CSS variables) as @variable |
226 | 212 | ((property_name) @variable |
227 | | - (#lua-match? @variable "^[-][-]")) |
| 213 | + (#match? @variable "^[-][-]")) |
228 | 214 |
|
229 | 215 | ((plain_value) @variable |
230 | | - (#lua-match? @variable "^[-][-]")) |
| 216 | + (#match? @variable "^[-][-]")) |
231 | 217 |
|
232 | 218 | (string_value) @string |
233 | 219 | (color_value) @string.special |
234 | 220 |
|
235 | | -(integer_value) @number |
236 | | -(float_value) @number.float |
237 | | -(unit) @type |
| 221 | +[ |
| 222 | + (integer_value) |
| 223 | + (float_value) |
| 224 | +] @number |
| 225 | +(unit) @type.unit |
238 | 226 |
|
239 | 227 | (boolean_value) @boolean |
240 | 228 | (null_value) @constant.builtin |
|
0 commit comments