- Notifications
You must be signed in to change notification settings - Fork 749
Closed
Labels
Closed Accepted by Editor DiscretionCommenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.Commenter has indicated satisfaction with the resolution / edits.css-nesting-1Current WorkCurrent Work
Description
first reported here : csstools/postcss-plugins#510
relevant specification parts:
https://www.w3.org/TR/css-nesting-1/#nest-selector
The nesting selector can be desugared by replacing it with the parent style rule’s selector, wrapped in an :is() selector. For example,
https://www.w3.org/TR/selectors-4/#matches-pseudo
Pseudo-elements cannot be represented by the matches-any pseudo-class; they are not valid within :is().
For this CSS :
.anything::before { @nest .something_else > & { color: black } }
&
should represent the matched element of the enclosing rule.
Which in this case is before
.
This CSS :
- is invalid
- is valid but never matches
- matches
.something_else > .anything::before
- matches
.something_else.anything::before
(or.something_else.anything :> before
)
Also relevant :
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Closed Accepted by Editor DiscretionCommenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.Commenter has indicated satisfaction with the resolution / edits.css-nesting-1Current WorkCurrent Work