on master help sign in
Update CSS syntax highlighting (#4882)
bf908ccChickenkeeper
languages.toml+1−1
@@ -426,7 +426,7 @@ indent = { tab-width = 2, unit = " " }
426
426
427[[grammar]]
427[[grammar]]
428name = "css"
428name = "css"
429−source = { git = "https://github.com/tree-sitter/tree-sitter-css", rev = "94e10230939e702b4fa3fa2cb5c3bc7173b95d07" }
429+source = { git = "https://github.com/tree-sitter/tree-sitter-css", rev = "769203d0f9abe1a9a691ac2b9fe4bb4397a73c51" }
430
430
431[[language]]
431[[language]]
432name = "scss"
432name = "scss"
runtime/queries/css/highlights.scm+68−47
@@ -1,64 +1,85 @@
1(comment) @comment
1(comment) @comment
2
2
3+[
3−(tag_name) @tag
4+ (tag_name)
4−(nesting_selector) @tag
5+ (nesting_selector)
5−(universal_selector) @tag
6+ (universal_selector)
7+] @tag
6
8
9+[
7−"~" @operator
10+ "~"
8−">" @operator
11+ ">"
9−"+" @operator
12+ "+"
10−"-" @operator
13+ "-"
11−"*" @operator
14+ "*"
12−"/" @operator
15+ "/"
13−"=" @operator
16+ "="
14−"^=" @operator
17+ "^="
15−"|=" @operator
18+ "|="
16−"~=" @operator
19+ "~="
17−"$=" @operator
20+ "$="
21+ "*="
18−"*=" @operator
22+] @operator
19
23
24+[
20−"and" @operator
25+ "and"
21−"or" @operator
22−"not" @operator
26+ "not"
23−"only" @operator
27+ "only"
24−
28+ "or"
25−(attribute_selector (plain_value) @string)
29+] @keyword.operator
26−(pseudo_element_selector (tag_name) @attribute)
27−(pseudo_class_selector (class_name) @attribute)
28−
29−(class_name) @variable.other.member
30−(id_name) @variable.other.member
31−(namespace_name) @variable.other.member
32−(property_name) @variable.other.member
33−(feature_name) @variable.other.member
34−
35−(attribute_name) @attribute
36−
37−(function_name) @function
38
30
39((property_name) @variable
31((property_name) @variable
40 (#match? @variable "^--"))
32 (#match? @variable "^--"))
41((plain_value) @variable
33((plain_value) @variable
42 (#match? @variable "^--"))
34 (#match? @variable "^--"))
43
35
44−"@media" @keyword
36+(attribute_name) @attribute
45−"@import" @keyword
37+(class_name) @label
38+(feature_name) @variable.other.member
39+(function_name) @function
40+(id_name) @label
41+(namespace_name) @namespace
42+(property_name) @variable.other.member
43+
44+[
46−"@charset" @keyword
45+ "@charset"
47−"@namespace" @keyword
46+ "@import"
48−"@supports" @keyword
49−"@keyframes" @keyword
47+ "@keyframes"
48+ "@media"
49+ "@namespace"
50+ "@supports"
50−(at_keyword) @keyword
51+ (at_keyword)
51−(to) @keyword
52−(from) @keyword
52+ (from)
53−(important) @keyword
53+ (important)
54+ (to)
55+] @keyword
56+
57+[
58+ "#"
59+ "."
60+] @punctuation
54
61
55(string_value) @string
62(string_value) @string
63+((color_value) "#") @string.special
56(color_value) @string.special
64(color_value) @string.special
57
65
58(integer_value) @constant.numeric.integer
66(integer_value) @constant.numeric.integer
59(float_value) @constant.numeric.float
67(float_value) @constant.numeric.float
60−(unit) @type
61
68
69+[
70+ ")"
71+ "("
72+ "["
73+ "]"
74+ "{"
75+ "}"
62−"#" @punctuation.delimiter
76+] @punctuation.bracket
63−"," @punctuation.delimiter
77+
78+[
79+ ","
80+ ";"
81+ ":"
82+ "::"
64−":" @punctuation.delimiter
83+] @punctuation.delimiter
84+
85+(plain_value) @constant