Re: [csswg-drafts] [css-nesting] How to resolve nested CSS with pseudo elements in the parent (#7433)

Adding a warning to the spec would be great! Anything that is invalid in `:is` is also invalid as a nesting ancestor (ancestor of the rule, not of the matched element)

At the moment this is implied but not clear beyond any possible confusion.

It's true that with nesting specifically stylesheet authors need to re-learn the feature and this is a painful process :/

It was inspired by sass nesting but it is completely different from that.
The first versions of the PostCSS plugin did something different altogether.

So stylesheet authors have an intuitive sense of how the feature should work that doesn't match how it will eventually work in browsers.

We already took some steps with the last major version of the PostCSS plugin but clearly more work is needed :)

------

A (style)lint rule that can spot invalid nesting would be awesome and doesn't exist yet.
This also gives faster feedback while typing.

-- 
GitHub Notification of comment by romainmenke
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7433#issuecomment-1177170332 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 7 July 2022 07:02:04 UTC