-
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: Highlight attribute selector (#1671)
This adds highlighting for CSS attributes selectors in CSS Extras
- Loading branch information
1 parent
f8c8add
commit 245b59d
Showing
4 changed files
with
301 additions
and
9 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.
269 changes: 269 additions & 0 deletions
269
tests/languages/css!+css-extras/selector_attribute_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,269 @@ | ||
[attr] {} | ||
|
||
[attr=val] {} | ||
[attr="val"] {} | ||
[attr='val'] {} | ||
[attr|=val] {} | ||
[attr~=val] {} | ||
[attr|=val] {} | ||
[attr^=val] {} | ||
[attr$=val] {} | ||
[attr*=val] {} | ||
|
||
[foo|attr][*|attr][|attr] {} | ||
[foo|attr|=val] {} | ||
|
||
[attr=val i] {} | ||
[attr="val" S] {} | ||
|
||
[ attr ] {} | ||
[ attr = val ] {} | ||
[ attr = val i] {} | ||
|
||
[attr="i#m :not(a.class)"] {} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "="], | ||
["value", "val"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "="], | ||
["value", "\"val\""], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "="], | ||
["value", "'val'"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "|="], | ||
["value", "val"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "~="], | ||
["value", "val"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "|="], | ||
["value", "val"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "^="], | ||
["value", "val"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "$="], | ||
["value", "val"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "*="], | ||
["value", "val"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["namespace", [ | ||
"foo", | ||
["punctuation", "|"] | ||
]], | ||
["attribute", "attr"], | ||
["punctuation", "]"] | ||
]], | ||
["attribute", [ | ||
["punctuation", "["], | ||
["namespace", [ | ||
"*", | ||
["punctuation", "|"] | ||
]], | ||
["attribute", "attr"], | ||
["punctuation", "]"] | ||
]], | ||
["attribute", [ | ||
["punctuation", "["], | ||
["namespace", [ | ||
["punctuation", "|"] | ||
]], | ||
["attribute", "attr"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["namespace", [ | ||
"foo", | ||
["punctuation", "|"] | ||
]], | ||
["attribute", "attr"], | ||
["operator", "|="], | ||
["value", "val"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "="], | ||
["value", "val"], | ||
["case-sensitivity", "i"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "="], | ||
["value", "\"val\""], | ||
["case-sensitivity", "S"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "="], | ||
["value", "val"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "="], | ||
["value", "val"], | ||
["case-sensitivity", "i"], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["selector", [ | ||
["attribute", [ | ||
["punctuation", "["], | ||
["attribute", "attr"], | ||
["operator", "="], | ||
["value", "\"i#m :not(a.class)\""], | ||
["punctuation", "]"] | ||
]] | ||
]], | ||
["punctuation", "{"], | ||
["punctuation", "}"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for attributes inside selectors. |
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