Re: [csswg-drafts] [css-nesting] Require `div&`, disallow `&div`, for Sass compat (#8662)

>  So all told, the difference is more like ~8 million to ~25 million, even before considering the longevity and relative usefulness of the two forms.

Sure, but these are still two sizable user groups.
I didn't mean to imply that both were equivalent in size, only that this isn't a `less than 1%` kind of thing.

-----

I had two concerns, one of which tabatkins addressed.

1 : That the feature would be harder to teach.

But I agree with [tabatkins on this](https://github.com/w3c/csswg-drafts/issues/8662#issuecomment-1490855942).
Restoring that restriction makes sense to me on it's own, while technically it is a "breaking change".

_Authors who absolutely want to start every selector with `&` and want to write `&div` can also write `&:is(div)`._

2 : That the adoption/usage of `&div` will only be determined by looking at a use counter in Chrome, ignoring that PostCSS and others exist. And ignoring the reality that people will continue to transpile their nested source to non-nested CSS for years to come.

They wrote CSS that works in the current Chrome version. That they transpile their source to support other browsers and older versions of Chrome should be taken into account.

Just an acknowledgment that some/any weight will given to the migration pains of these CSS authors would be sufficient.

------

> The type of breakage is also significant. Any project following the current Nesting spec which allows `&div` can just switch to outputting `div&` - `&div` being a syntax error in raw CSS means that there's no harm in recognizing it and correcting the output.

Indeed, we will handle this similarly as we will handle the removal of `@nest`.
- emit warnings when the pattern is detected to create awareness.
- a plugin to patch source from the old specification to the new when authors transpile
- a stylelint plugin to actually fix source code

This combination is the least disruptive.

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


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

Received on Friday, 31 March 2023 06:23:23 UTC