8000 [css-nesting-1] Syntax Invites Errors · Issue #7834 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-nesting-1] Syntax Invites Errors #7834

@fantasai

Description

@fantasai

Edit: 👉🏼 UPDATED SUMMARY TABLE OF SYNTAX PROPOSALS 👈🏼 (from #7834 (comment) )


As mentioned in #7796, there are some problems with the currently-proposed nesting syntax:

  • selectors within nested context are incompatible with those outside of nested context, and with syntax within @scope, which invites a lot of copy-paste errors when transferring code among these contexts
  • the requirement to include & within all the selectors in a list even beyond syntactic disambiguation (instead of allowing relative selectors) is annoying to type, easy to forget, and makes automated (and manual) conversion of existing code much more difficult (requires selector parsing rather than regex).
  • &.foo and & .foo are easily confusable (both for reading and for typing), and so long as the latter is required for nested relative selectors this will be a commonly encountered problem

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0