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

Indeed, an ampersand wouldn't be required. I would write it anyway, and we can require it if we want to, but the `@nest;` is enough for the parser to know it's getting selectors from there on out, so there's no ambiguity at play.

Not sure if an `@end-nest` would be necessarily useful; one can always just re-write the entire selector (and concatenate it to the stylesheet). Perhaps it could be something for the future if the need is there; but for now let's keep it basic.

The inconsistency about at-rules is valid, but only to a certain extent; CSS already has things like `@charset "utf-8";` and `@import url(https://example.com/sheet.css);`, which are not followed by a block at all. There's the `@page` rule which doesn't need `(parameters)` and CSS recently got `@layer` which kind of just does everything (i.e. `@layer foo;`, `@layer foo {}` and `@layer {}` are all valid). Granted, `@nest;` is a little different from all of them because it's not followed by a block nor an ident but given what CSS already has I really don't see why `@nest;` would syntactically be an issue.

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


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

Received on Thursday, 1 September 2022 07:15:15 UTC