fix: global with pseudo element should be considered as global

pull/6317/head
Roy Choo 5 years ago
parent a1600ff68e
commit ffa3c559e9

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

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