mdn / content

The content behind MDN Web Docs
https://developer.mozilla.org
Other
9.22k stars 22.5k forks source link

The `&` CSS nesting selector has gotchas/footguns/confusing behaviors that should be documented #36888

Open aeharding opened 1 day ago

aeharding commented 1 day ago

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/Nesting_selector

What specific section or headline is this issue about?

No response

What information was incorrect, unhelpful, or incomplete?

This page should document the gotchas and footguns in comparison to SCSS/less/stylus etc implementations of the & selector.

CSS nesting does not behave like preprocessor nesting, and it is not intuitive for developers (and even browser vendors) in many edge cases.

What did you expect to see?

A section on gotchas. The section should include easily digestible examples of things that developers expect to work (like & inside pseudo-selectors) but don't.

Do you have any supporting links, references, or citations?

Do you have anything more you want to share?

No response