fix: :global(...):some-pseudoclass should be considered global (#6317)

pull/6314/head
Roy Choo 4 years ago committed by GitHub
parent 3c889da6b7
commit 228832c9a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -607,9 +607,10 @@ class Block {
get global() {
return (
this.selectors.length === 1 &&
this.selectors.length >= 1 &&
this.selectors[0].type === 'PseudoClassSelector' &&
this.selectors[0].name === 'global'
this.selectors[0].name === 'global' &&
this.selectors.every((selector) => selector.type === 'PseudoClassSelector')
);
}
}

@ -0,0 +1,15 @@
[{
"code": "css-invalid-global",
"message": ":global(...) can be at the start or end of a selector sequence, but not in the middle",
"start": {
"line": 2,
"column": 6,
"character": 14
},
"end": {
"line": 2,
"column": 19,
"character": 27
},
"pos": 14
}]

@ -0,0 +1,5 @@
<style>
.foo :global(.bar):first-child .baz {
color: red;
}
</style>
Loading…
Cancel
Save