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

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