summaryrefslogtreecommitdiff
path: root/runtime/queries/css
diff options
context:
space:
mode:
authorChickenkeeper2022-11-28 01:11:12 +0000
committerGitHub2022-11-28 01:11:12 +0000
commitbf908cc4a11b7567800b2e3d5b48b5b29a330911 (patch)
tree8ff2801b74588bbeb302e82dc107ae2d0e07245d /runtime/queries/css
parent583c2a5456263865c8aaf8b260909bfe431db549 (diff)
Update CSS syntax highlighting (#4882)
Diffstat (limited to 'runtime/queries/css')
-rw-r--r--runtime/queries/css/highlights.scm115
1 files changed, 68 insertions, 47 deletions
diff --git a/runtime/queries/css/highlights.scm b/runtime/queries/css/highlights.scm
index 4dfc0c66..b5262e8f 100644
--- a/runtime/queries/css/highlights.scm
+++ b/runtime/queries/css/highlights.scm
@@ -1,64 +1,85 @@
(comment) @comment
-(tag_name) @tag
-(nesting_selector) @tag
-(universal_selector) @tag
+[
+ (tag_name)
+ (nesting_selector)
+ (universal_selector)
+] @tag
-"~" @operator
-">" @operator
-"+" @operator
-"-" @operator
-"*" @operator
-"/" @operator
-"=" @operator
-"^=" @operator
-"|=" @operator
-"~=" @operator
-"$=" @operator
-"*=" @operator
+[
+ "~"
+ ">"
+ "+"
+ "-"
+ "*"
+ "/"
+ "="
+ "^="
+ "|="
+ "~="
+ "$="
+ "*="
+] @operator
-"and" @operator
-"or" @operator
-"not" @operator
-"only" @operator
-
-(attribute_selector (plain_value) @string)
-(pseudo_element_selector (tag_name) @attribute)
-(pseudo_class_selector (class_name) @attribute)
-
-(class_name) @variable.other.member
-(id_name) @variable.other.member
-(namespace_name) @variable.other.member
-(property_name) @variable.other.member
-(feature_name) @variable.other.member
-
-(attribute_name) @attribute
-
-(function_name) @function
+[
+ "and"
+ "not"
+ "only"
+ "or"
+] @keyword.operator
((property_name) @variable
(#match? @variable "^--"))
((plain_value) @variable
(#match? @variable "^--"))
-"@media" @keyword
-"@import" @keyword
-"@charset" @keyword
-"@namespace" @keyword
-"@supports" @keyword
-"@keyframes" @keyword
-(at_keyword) @keyword
-(to) @keyword
-(from) @keyword
-(important) @keyword
+(attribute_name) @attribute
+(class_name) @label
+(feature_name) @variable.other.member
+(function_name) @function
+(id_name) @label
+(namespace_name) @namespace
+(property_name) @variable.other.member
+
+[
+ "@charset"
+ "@import"
+ "@keyframes"
+ "@media"
+ "@namespace"
+ "@supports"
+ (at_keyword)
+ (from)
+ (important)
+ (to)
+] @keyword
+
+[
+ "#"
+ "."
+] @punctuation
(string_value) @string
+((color_value) "#") @string.special
(color_value) @string.special
(integer_value) @constant.numeric.integer
(float_value) @constant.numeric.float
-(unit) @type
-"#" @punctuation.delimiter
-"," @punctuation.delimiter
-":" @punctuation.delimiter
+[
+ ")"
+ "("
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ ","
+ ";"
+ ":"
+ "::"
+] @punctuation.delimiter
+
+(plain_value) @constant