Support :host and :host-context pseudo class selectors #216
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These are defined in https://w3c.github.io/csswg-drafts/css-scoping/#host-selector
:host
:host(<compound-selector>)
:host-context(<compound-selector>)
With this PR, CSSTree will now parse them, instead of returning a
Raw
AST.Limitations of this PR:
<complex-selector>
as the argument to:host()
and:host-context()
. I don’t consider this blocking to this PR as CSSTree has the same problem with::slotted()
for example. See issue CSSTree does not differentiate between<compound-selector>
and<complex-selector>
#214.:host-context
should be invalid yet CSSTree does not consider it as such. I don’t consider this blocking to this PR as CSSTree has the same problem with:has
vs:has()
. See issue Pseudos that require an argument parse fine, although they shouldn’t #215.