-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only check selector that are direct children of
:global
(#6435)
* failing test for i6434 * use string match to simplify regexp * more tests * separate test suite * test for commas inside attributes * stricter regex pattern * test escaped brackets and parentheses * change latest test selector to lists * correct failing test for escaped parentheses * update with proposed pattern
- Loading branch information
1 parent
f757de3
commit 8c3fb92
Showing
7 changed files
with
91 additions
and
1 deletion.
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
17 changes: 17 additions & 0 deletions
17
test/validator/samples/css-invalid-global-selector-2/errors.json
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,17 @@ | ||
[ | ||
{ | ||
"code": "css-invalid-global-selector", | ||
"message": ":global(...) must contain a single selector", | ||
"start": { | ||
"line": 11, | ||
"column": 5, | ||
"character": 156 | ||
}, | ||
"end": { | ||
"line": 11, | ||
"column": 29, | ||
"character": 180 | ||
}, | ||
"pos": 156 | ||
} | ||
] |
18 changes: 18 additions & 0 deletions
18
test/validator/samples/css-invalid-global-selector-2/input.svelte
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,18 @@ | ||
<style> | ||
div :global(:is(h1, h2)) { | ||
color: red; | ||
} | ||
div :global(:where(h1, h2)) { | ||
color: red; | ||
} | ||
div :global(h1 ~ :is(h2, h3)) { | ||
color: red; | ||
} | ||
div :global(:is(h1, h2), h3) { | ||
color: red; | ||
} | ||
</style> | ||
|
||
<div> | ||
<h1>hello world</h1> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
test/validator/samples/css-invalid-global-selector-3/errors.json
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,17 @@ | ||
[ | ||
{ | ||
"code": "css-invalid-global-selector", | ||
"message": ":global(...) must contain a single selector", | ||
"start": { | ||
"line": 5, | ||
"column": 5, | ||
"character": 77 | ||
}, | ||
"end": { | ||
"line": 5, | ||
"column": 44, | ||
"character": 116 | ||
}, | ||
"pos": 77 | ||
} | ||
] |
12 changes: 12 additions & 0 deletions
12
test/validator/samples/css-invalid-global-selector-3/input.svelte
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,12 @@ | ||
<style> | ||
div :global(h1[data-title="Hello, world!"]) { | ||
color: red; | ||
} | ||
div :global(h1[attribute], video[autoplay]) { | ||
color: red; | ||
} | ||
</style> | ||
|
||
<div> | ||
<h1>hello world</h1> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
test/validator/samples/css-invalid-global-selector-4/errors.json
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,17 @@ | ||
[ | ||
{ | ||
"code": "css-invalid-global-selector", | ||
"message": ":global(...) must contain a single selector", | ||
"start": { | ||
"line": 2, | ||
"column": 5, | ||
"character": 13 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"column": 24, | ||
"character": 32 | ||
}, | ||
"pos": 13 | ||
} | ||
] |
9 changes: 9 additions & 0 deletions
9
test/validator/samples/css-invalid-global-selector-4/input.svelte
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,9 @@ | ||
<style> | ||
div :global(h1, .abc\)) { | ||
color: red; | ||
} | ||
</style> | ||
|
||
<div> | ||
<h1>hello world</h1> | ||
</div> |