File tree Expand file tree Collapse file tree 3 files changed +34
-8
lines changed
Expand file tree Collapse file tree 3 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,20 @@ Prism.languages.css.selector = {
3636 'operator' : / [ | ~ * ^ $ ] ? = /
3737 }
3838 } ,
39- 'n-th' : {
40- pattern : / ( \( \s * ) [ + - ] ? \d * [ \d n ] (?: \s * [ + - ] \s * \d + ) ? (? = \s * \) ) / ,
41- lookbehind : true ,
42- inside : {
43- 'number' : / [ \d n ] + / ,
44- 'operator' : / [ + - ] /
39+ 'n-th' : [
40+ {
41+ pattern : / ( \( \s * ) [ + - ] ? \d * [ \d n ] (?: \s * [ + - ] \s * \d + ) ? (? = \s * \) ) / ,
42+ lookbehind : true ,
43+ inside : {
44+ 'number' : / [ \d n ] + / ,
45+ 'operator' : / [ + - ] /
46+ }
47+ } ,
48+ {
49+ pattern : / ( \( \s * ) (?: e v e n | o d d ) (? = \s * \) ) / i,
50+ lookbehind : true
4551 }
46- } ,
52+ ] ,
4753 'punctuation' : / [ ( ) ] /
4854 }
4955} ;
Original file line number Diff line number Diff line change 22:nth-child(+2n - 1) {}
33:nth-child(2n) {}
44:nth-child(+5) {}
5+ :nth-child(even) {}
6+ :nth-child(odd) {}
57
68----------------------------------------------------
79
5456 ["punctuation", ")"]
5557 ]],
5658 ["punctuation", "{"],
59+ ["punctuation", "}"],
60+
61+ ["selector", [
62+ ["pseudo-class", ":nth-child"],
63+ ["punctuation", "("],
64+ ["n-th", "even"],
65+ ["punctuation", ")"]
66+ ]],
67+ ["punctuation", "{"],
68+ ["punctuation", "}"],
69+
70+ ["selector", [
71+ ["pseudo-class", ":nth-child"],
72+ ["punctuation", "("],
73+ ["n-th", "odd"],
74+ ["punctuation", ")"]
75+ ]],
76+ ["punctuation", "{"],
5777 ["punctuation", "}"]
5878]
5979
You can’t perform that action at this time.
0 commit comments