Re: [csswg-drafts] [css-nesting-1] Syntax Invites Errors (#7834)

There are a lot of comments about how “converting from XX framework is not a big problem”. Yeah, I agree; it's a one-time cost, you can run a script. That was not the point about conversion I opened this issue for; rather, it is specifically about copying code from one context to another _in pure CSS_. People write CSS within nested contexts and outside it, and within our future `@scope` rules and outside it, and it is _quite reasonable and common_ to copy code from one place to another. Copying code should work with minimal friction. Switching a block from nesting to scoping should work without friction. That's the issue.

Making & valid outside of nesting is great, we should do it, that's a [separate issue](https://github.com/w3c/csswg-drafts/issues/5745), and it doesn't solve the problem that most unnested CSS code is written without it today and will likely continue to be written without it in the future.

As for the performance concerns of descendant selectors: authors want to use descendant selectors, and they will. I expect whether we require & here or not will hardly make a difference.

In the future, some large percentage of CSS rules will be nested. Whatever we do here, it needs to be ergonomic enough to be used for the majority of style rules in a website. And it needs to work naturally with `@scope`.

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


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

Received on Tuesday, 11 October 2022 01:05:35 UTC