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

pull/7738/head
Roy Choo 5 years ago committed by GitHub
parent 95a6e2577f
commit 6e14869b19

@ -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