|
1 | 1 | [ |
2 | 2 | (comment) |
3 | 3 | (single_line_comment) |
4 | | - (sassdoc_block) |
5 | 4 | ] @comment |
6 | 5 |
|
| 6 | +(sassdoc_block) @comment.doc |
| 7 | + |
| 8 | +(tag_name) @tag |
| 9 | + |
7 | 10 | [ |
8 | | - (tag_name) |
9 | 11 | (universal_selector) |
10 | 12 | (nesting_selector) |
11 | | -] @tag |
| 13 | +] @character.special |
12 | 14 |
|
13 | 15 | (attribute_selector (plain_value) @string) |
14 | 16 | (parenthesized_query |
|
60 | 62 | (unary_expression "not" @keyword.operator) |
61 | 63 | ] |
62 | 64 |
|
63 | | -(pseudo_element_selector "::" (tag_name) @selector.pseudo) |
64 | | -(pseudo_class_selector ":" (class_name) @selector.pseudo) |
65 | | -(page_pseudo_class) @selector.pseudo |
| 65 | +(pseudo_element_selector "::" (tag_name) @attribute) |
| 66 | +(pseudo_class_selector ":" (class_name) @attribute) |
| 67 | +(page_pseudo_class) @attribute |
66 | 68 |
|
67 | 69 | [ |
68 | 70 | (variable_name) |
69 | 71 | (variable_value) |
70 | | -] @variable.other.member |
| 72 | +] @variable |
71 | 73 |
|
72 | | -(container_statement (container_name) @variable.other.member) |
| 74 | +(container_statement (container_name) @variable) |
73 | 75 |
|
74 | 76 | (argument_name) @variable.parameter |
75 | 77 |
|
|
79 | 81 | (property_name) |
80 | 82 | ] @property |
81 | 83 |
|
82 | | -(id_name) @selector.id |
83 | | -(class_name) @selector.class |
84 | | -(placeholder_name) @selector.class |
85 | | -(namespace_name) @namespace |
86 | | -(namespace_selector (tag_name) @namespace "|") |
87 | | -(variable_module (module) @namespace) |
88 | | -(call_expression module: (module) @namespace) |
| 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) |
89 | 91 |
|
90 | | -(attribute_name) @attribute |
| 92 | +(attribute_name) @tag.attribute |
91 | 93 |
|
92 | 94 | [ |
93 | 95 | (function_name) |
|
99 | 101 |
|
100 | 102 | [ |
101 | 103 | (plain_value) |
102 | | - (keyframes_name) |
103 | 104 | (keyword_query) |
104 | 105 | (feature_value) |
105 | 106 | ] @constant.builtin |
106 | 107 |
|
| 108 | +(keyframes_name) @variable |
| 109 | + |
107 | 110 | (interpolation "#{" @punctuation.special "}" @punctuation.special) |
108 | 111 |
|
109 | 112 | [ |
|
128 | 131 | "@debug" |
129 | 132 | "@error" |
130 | 133 | "@extend" |
131 | | - "@mixin" |
132 | 134 | "@warn" |
133 | 135 | (at_keyword) |
| 136 | + (margin_at_keyword) |
| 137 | + (font_feature_value_keyword) |
| 138 | +] @keyword.directive |
| 139 | + |
| 140 | +[ |
134 | 141 | (to) |
135 | 142 | (from) |
| 143 | +] @keyword |
| 144 | + |
| 145 | +[ |
136 | 146 | (important) |
137 | 147 | (default) |
138 | 148 | (global) |
139 | | - (margin_at_keyword) |
140 | | - (font_feature_value_keyword) |
141 | | -] @keyword |
| 149 | +] @keyword.modifier |
142 | 150 |
|
143 | 151 | ; Scope bare keyword strings to their parent nodes to avoid |
144 | 152 | ; false matches inside identifiers (e.g. "as" in "ease-out"). |
|
175 | 183 |
|
176 | 184 | (attr_type (keyword) @keyword) |
177 | 185 | (syntax_type) @type |
178 | | -(if_else_condition) @keyword.control.conditional |
| 186 | +(if_else_condition) @keyword.conditional |
179 | 187 |
|
180 | 188 | (style_condition |
181 | 189 | (property_name) @property) |
|
184 | 192 | (state_name) @property |
185 | 193 | (state_value) @constant.builtin) |
186 | 194 |
|
187 | | -"@function" @keyword.function |
| 195 | +[ |
| 196 | + "@function" |
| 197 | + "@mixin" |
| 198 | +] @keyword.function |
188 | 199 |
|
189 | | -"@return" @keyword.control.return |
| 200 | +"@return" @keyword.return |
190 | 201 |
|
191 | 202 | [ |
192 | 203 | "@else" |
193 | 204 | "@if" |
194 | | -] @keyword.control.conditional |
195 | | -(else_if_clause "if" @keyword.control.conditional) |
| 205 | +] @keyword.conditional |
| 206 | +(else_if_clause "if" @keyword.conditional) |
196 | 207 |
|
197 | 208 | ; Scope loop keywords to their parent nodes |
198 | 209 | [ |
|
209 | 220 | "@import" |
210 | 221 | "@include" |
211 | 222 | "@use" |
212 | | -] @keyword.control.import |
| 223 | +] @keyword.import |
| 224 | + |
| 225 | +; Custom properties (CSS variables) as @variable |
| 226 | +((property_name) @variable |
| 227 | + (#lua-match? @variable "^[-][-]")) |
| 228 | + |
| 229 | +((plain_value) @variable |
| 230 | + (#lua-match? @variable "^[-][-]")) |
213 | 231 |
|
214 | 232 | (string_value) @string |
215 | 233 | (color_value) @string.special |
216 | 234 |
|
217 | | -[ |
218 | | - (integer_value) |
219 | | - (float_value) |
220 | | -] @number |
221 | | -(unit) @type.unit |
| 235 | +(integer_value) @number |
| 236 | +(float_value) @number.float |
| 237 | +(unit) @type |
222 | 238 |
|
223 | 239 | (boolean_value) @boolean |
224 | 240 | (null_value) @constant.builtin |
|
0 commit comments