Re: [csswg-drafts] [css-nesting-1] Yet another nesting proposal (Option 5) (#7970)

> {{ and }} shouldn't allow spaces inside double braces. If a parser encountered {{, it means that it is a nested block.

1) That doesn't remove the lookahead, the parser can't tell if it's parsing a regular style rule or a nesting container until it finds the `{{`. They are completely different objects in the OM so the parser needs to know ASAP. The selector can be arbitrarily long (and even have multiple selectors separated by `,`s), current CSS parsers don't require more than a handful of token lookaheads and we try to not add more, especially an arbitrary amount.
2) That effectively introduces `{{` and `}}` as new sigils, either through a parsing change or a one-off rule.

> {{{ should not be allowed.

Why not? The `&` is optional, requiring a space after the opening `{{` is arbitrary. We generally don't require specific formatting in CSS. This is just introducing more arbitrary rules that authors will have to learn. One of the main points of this proposal is to remove those as found in the other proposals. Another is to avoid parser changes. Yet another is to make the feature obvious and searchable.

You're adding a bunch of complexity and author pain to save 4 characters.

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


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

Received on Monday, 5 December 2022 20:43:06 UTC