W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2018

Re: [csswg-drafts] [css-nesting] request to pick up the css-nesting proposal

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Fri, 01 Jun 2018 21:20:07 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-394012023-1527888006-sysbot+gh@w3.org>
That's theoretically possible, sure; no grammar problems with it. But it means that now there's 3 nesting forms: if you're nesting with a combinator, use it directly (but you *can* use `&` if you want); if you're nesting by just adding more selectors, you have to use `&`; if you're doing anything more complicated, you have to use `@nest`.

The current rules are simpler - when you nest, you need to produce a full new selector with a `&` in it, referring to whatever's matched by the parent selector; if the `&` isn't the very first thing, you have to use `@nest`.  The requirement is straightforward, and the condition for changing to `@nest` is visually obvious. I think this simplicity is pretty valuable!

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2701#issuecomment-394012023 using your GitHub account
Received on Friday, 1 June 2018 21:20:09 UTC

This archive was generated by hypermail 2.3.1 : Friday, 1 June 2018 21:20:10 UTC