Re: [csswg-drafts] [css-nesting] Problem with mixing properties and selectors (#8249)

One question I would like to add before today's meeting: can at least make the current draft a lookahead of `1`?

The proposal would be as follow: to be considered a property declaration, the current token sequence should start with an identifier immediately followed by a colon (notwithstanding whitespace).

This would allow to drop the `&` in many more cases where selectors start with a tag name (which unlike what some seem to argue, is very common). It would however break for selectors like `a:hover` but I think this is easier to explain to developers, and also will be visibly different in syntax highlighting, making it directly clear what the error is.

This will reduce the buden while converting stylesheets to nested rules quite a lot, and would reduce the "syntactic disadvantage" given to tag selectors in CSS.

If, at a later date, implementors want to pursue further lookahead relaxation, this is still possible, but at least, we already start by enforcing some.

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


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

Received on Tuesday, 17 January 2023 15:54:55 UTC