-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSS: Added support for the selector function (#2201)
This adds support for CSS 4's selector function. The selectors passed to the function will now be highlighted as such.
- Loading branch information
1 parent
a7d67ca
commit 2e0eff7
Showing
7 changed files
with
72 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/languages/css!+css-extras/atrule_selector-function-argument_feature.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@supports selector(::-webkit-foo) { | ||
/* style to apply when the `::-webkit-foo` selector is actually supported, | ||
* instead of just being parsed as matching nothing because of Selectors 4 | ||
* § Appendix B: https://drafts.csswg.org/selectors-4/#compat */ | ||
} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["atrule", [ | ||
["rule", "@supports"], | ||
["function", "selector"], | ||
["punctuation", "("], | ||
["selector-function-argument", [ | ||
["pseudo-element", "::-webkit-foo"] | ||
]], | ||
["punctuation", ")"] | ||
]], | ||
["punctuation", "{"], | ||
["comment", "/* style to apply when the `::-webkit-foo` selector is actually supported,\r\n\t * instead of just being parsed as matching nothing because of Selectors 4\r\n\t * § Appendix B: https://drafts.csswg.org/selectors-4/#compat */"], | ||
["punctuation", "}"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for the selector function in @supports rules. |
24 changes: 24 additions & 0 deletions
24
tests/languages/css/atrule_selector-function-argument_feature.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@supports selector(::-webkit-foo) { | ||
/* style to apply when the `::-webkit-foo` selector is actually supported, | ||
* instead of just being parsed as matching nothing because of Selectors 4 | ||
* § Appendix B: https://drafts.csswg.org/selectors-4/#compat */ | ||
} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["atrule", [ | ||
["rule", "@supports"], | ||
["function", "selector"], | ||
["punctuation", "("], | ||
["selector-function-argument", "::-webkit-foo"], | ||
["punctuation", ")"] | ||
]], | ||
["punctuation", "{"], | ||
["comment", "/* style to apply when the `::-webkit-foo` selector is actually supported,\r\n\t * instead of just being parsed as matching nothing because of Selectors 4\r\n\t * § Appendix B: https://drafts.csswg.org/selectors-4/#compat */"], | ||
["punctuation", "}"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for the selector function in @supports rules. |