Re: [csswg-drafts] [css-nesting-1] Syntax Invites Errors (#7834)

I think the important thing is to be consistent. Requiring `&` in some cases but not others is confusing for beginners and advanced authors alike. Unlike semicolons and braces, `&` has a significant impact on the meaning of the rule. With `&`, it's immediately obvious where the "context" (i.e. parent) is inserted into the selector. When it isn't required, authors must either know the rules about how it's automatically inserted or guess about it. This creates more to learn, forget, misunderstand, etc. leading to frustration and bugs.

Sure, lint rules can be invented, but why create this confusion in the first place? IMO, if we're even talking about a lint rule being needed to disable a new language feature, it's probably not a good idea. Especially since the only benefit is saving a single character per rule. Perhaps users of SASS will need to re-learn things, but the majority of CSS developers have never used SASS so I don't think this is a good argument. Plus, the nesting syntax already works differently in other ways as @romainmenke mentioned, so re-learning will be necessary either way. Clarity and consistency is far more important than SASS compatibility in my opinion.

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


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

Received on Thursday, 6 October 2022 17:19:24 UTC