Skip to content

Commit b419371

Browse files
committed
feat(queries): Update CSS highlights.scm
1 parent 5cd392a commit b419371

File tree

2 files changed

+96
-60
lines changed

2 files changed

+96
-60
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## Unreleased
4+
- Update `CSS` highlights.scm
45

56
## 0.12.191 - 2024-05-06
67
- Add `Purescript` support

queries/css/highlights.scm

Lines changed: 95 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,105 @@
1-
(comment) @comment
1+
[
2+
"@media"
3+
"@charset"
4+
"@namespace"
5+
"@supports"
6+
"@keyframes"
7+
(at_keyword)
8+
] @keyword.directive
29

3-
;; (selectors) @function
10+
"@import" @keyword.import
11+
12+
[
13+
(to)
14+
(from)
15+
] @keyword
16+
17+
(comment) @comment @spell
418

519
(tag_name) @tag
6-
(nesting_selector) @tag
7-
(universal_selector) @tag
8-
9-
(id_selector) @function
10-
(class_selector) @type
11-
12-
"~" @operator
13-
">" @operator
14-
"+" @operator
15-
"-" @operator
16-
"*" @operator
17-
"/" @operator
18-
"=" @operator
19-
"^=" @operator
20-
"|=" @operator
21-
"~=" @operator
22-
"$=" @operator
23-
"*=" @operator
24-
25-
"and" @operator
26-
"or" @operator
27-
"not" @operator
28-
"only" @operator
29-
30-
(attribute_selector (plain_value) @string)
31-
(pseudo_element_selector (tag_name) @attribute)
32-
(pseudo_class_selector (class_name) @attribute)
33-
34-
;; (class_name) @property
35-
;; (id_name) @property
36-
(namespace_name) @property
37-
(property_name) @variable
38-
(feature_name) @property
39-
40-
(attribute_name) @attribute
20+
(class_name) @tag
21+
(id_name) @tag
22+
23+
[
24+
(property_name)
25+
(feature_name)
26+
] @property
27+
28+
[
29+
(nesting_selector)
30+
(universal_selector)
31+
] @character.special
4132

4233
(function_name) @function
4334

35+
[
36+
"~"
37+
">"
38+
"+"
39+
"-"
40+
"*"
41+
"/"
42+
"="
43+
"^="
44+
"|="
45+
"~="
46+
"$="
47+
"*="
48+
] @operator
49+
50+
[
51+
"and"
52+
"or"
53+
"not"
54+
"only"
55+
] @keyword.operator
56+
57+
(important) @keyword.modifier
58+
59+
(attribute_selector
60+
(plain_value) @string)
61+
62+
(pseudo_element_selector
63+
"::"
64+
(tag_name) @attribute)
65+
66+
(pseudo_class_selector
67+
(class_name) @attribute)
68+
69+
(attribute_name) @tag.attribute
70+
71+
(namespace_name) @module
72+
4473
((property_name) @variable
45-
(.match? @variable "^--"))
74+
(#lua-match? @variable "^[-][-]"))
75+
4676
((plain_value) @variable
47-
(.match? @variable "^--"))
48-
49-
"@media" @keyword
50-
"@import" @keyword
51-
"@charset" @keyword
52-
"@namespace" @keyword
53-
"@supports" @keyword
54-
"@keyframes" @keyword
55-
(at_keyword) @keyword
56-
(to) @keyword
57-
(from) @keyword
58-
(important) @keyword
59-
60-
(string_value) @string
61-
(color_value) @string.special
62-
63-
(unit) @type
77+
(#lua-match? @variable "^[-][-]"))
78+
79+
[
80+
(string_value)
81+
(color_value)
82+
(unit)
83+
] @string
84+
6485
(integer_value) @number
65-
(float_value) @number
66-
(plain_value) @keyword
67-
;; (color_value) @attribute
6886

69-
"#" @punctuation.delimiter
70-
"," @punctuation.delimiter
87+
(float_value) @number.float
88+
89+
[
90+
"#"
91+
","
92+
"."
93+
":"
94+
"::"
95+
";"
96+
] @punctuation.delimiter
97+
98+
[
99+
"{"
100+
")"
101+
"("
102+
"}"
103+
"["
104+
"]"
105+
] @punctuation.bracket

0 commit comments

Comments
 (0)