:global() with pseudo element should be considered as global (#6470)

pull/6473/head
Tan Li Hau 4 years ago committed by GitHub
parent 98ddf8b588
commit fca6a6d38a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -610,7 +610,7 @@ class Block {
this.selectors.length >= 1 &&
this.selectors[0].type === 'PseudoClassSelector' &&
this.selectors[0].name === 'global' &&
this.selectors.every((selector) => selector.type === 'PseudoClassSelector')
this.selectors.every((selector) => selector.type === 'PseudoClassSelector' || selector.type === 'PseudoElementSelector')
);
}
}

@ -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": 5,
"column": 6,
"character": 60
},
"end": {
"line": 5,
"column": 19,
"character": 73
},
"pos": 60
}]

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