Re: [csswg-drafts] [css-nesting] Syntax suggestion (#4748)

I think I prefer my second idea from that comment:

> Alternate idea: What if only the _first_ rule needs to start with `&`, then we can just assume the rest are selectors and not properties. Then, if anyone wants to handle this generically (e.g. when migrating from a preprocessor), only 3 characters need to be prepended to the list of nested rules: `&{}`.

This gives you the best of both worlds: no need to prefix with anything for most stylesheets, only a three letter prefix if your first rule does not start with `&`. No `@nest`, no other weird `@rules` or double syntax, and an easy to remember rule: your first nested selector must start with `&`.

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


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

Received on Wednesday, 10 November 2021 17:20:40 UTC