W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2020

Re: [csswg-drafts] [css-nesting] Make @nest default to descendant when no & is present (#5738)

From: Brad Kemper via GitHub <sysbot+gh@w3.org>
Date: Fri, 20 Nov 2020 23:46:06 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-731463818-1605915964-sysbot+gh@w3.org>
Since one of the reasons for @nest is: "some people find the nesting challenging to distinguish visually from the surrounding declarations" when using direct nesting (meaning that for some people all nesting would be with the at rule), and @nest is supposed to impose "fewer restrictions on how to validly nest style rules", I agree that it should be possible to author without the nesting selector inside the @nest when there is no ambiguity. 

I think `@nest .bar` should just mean `.foo .bar`. If you want `.foo.bar` or `.foo > .bar`, then you would use the nesting selector (`@nest &.bar` or `@nest & > .bar`). Even `@nest > .bar` (or `@nest> .bar`) should be allowed, I'd say, since that is also not ambiguous. A space (or lack thereof after @nest in places where spaces are optional without changing the meaning) should just represent a space after the parent.

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 20 November 2020 23:46:07 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:22 UTC