File tree 3 files changed +27
-4
lines changed
3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,14 @@ Prism.languages.css.selector = {
9
9
}
10
10
} ;
11
11
12
- Prism . languages . insertBefore ( 'css' , 'function ' , {
12
+ Prism . languages . insertBefore ( 'css' , 'property ' , {
13
13
'variable' : {
14
- pattern : / ( v a r \( ) [ ^ ) ] + (? = \) ) / ,
14
+ pattern : / ( ^ | [ ^ - \w \xA0 - \uFFFF ] ) - - [ - _ a - z \xA0 - \uFFFF ] [ - \w \xA0 - \uFFFF ] * / i ,
15
15
lookbehind : true
16
- } ,
16
+ }
17
+ } ) ;
18
+
19
+ Prism . languages . insertBefore ( 'css' , 'function' , {
17
20
'operator' : {
18
21
pattern : / ( \s ) [ + \- * \/ ] (? = \s ) / ,
19
22
lookbehind : true
Original file line number Diff line number Diff line change
1
+ element {
2
+ --foo: green;
3
+ }
4
+
1
5
var(--color-primary)
2
6
var(--level-3)
7
+ var(--foo, red)
3
8
calc(100% - var(--margin-size) * 2)
4
9
5
10
----------------------------------------------------
6
11
7
12
[
13
+ ["selector", ["element"]],
14
+ ["punctuation", "{"],
15
+ ["variable", "--foo"],
16
+ ["punctuation", ":"],
17
+ " green",
18
+ ["punctuation", ";"],
19
+ ["punctuation", "}"],
20
+
8
21
["function", "var"],
9
22
["punctuation", "("],
10
23
["variable", "--color-primary"],
@@ -15,6 +28,13 @@ calc(100% - var(--margin-size) * 2)
15
28
["variable", "--level-3"],
16
29
["punctuation", ")"],
17
30
31
+ ["function", "var"],
32
+ ["punctuation", "("],
33
+ ["variable", "--foo"],
34
+ ["punctuation", ","],
35
+ " red",
36
+ ["punctuation", ")"],
37
+
18
38
["function", "calc"],
19
39
["punctuation", "("],
20
40
["number", "100"],
You can’t perform that action at this time.
0 commit comments