Skip to content

[selectors-5][css-syntax] Resolve to use '/' [<ident> | <function>] '/' syntax for all future combinators (except for good reason) #12451

Open
@LeaVerou

Description

@LeaVerou

This was brought to my attention by this comment. The selectors-5 spec currently defines a general idref combinator as just /<attribute-name>/ (e.g. /for/). It looks like it was originally drafted by @tabatkins 11 years ago (when we were indeed thinking of having a /for/) and then ported to selectors-5 by @dbaron about a year ago.

I was under the impression we decided to use the slash syntax for any new combinator, in which case idrefs (or general attribute refs) would need additional namespacing, otherwise we can't use this syntax for any other combinator (e.g. /slotted/) because anything can potentially conflict with an attribute name.

I think we should get a resolution on this and change the selectors-5 section accordingly (and/or add a "Not ready for implementation" banner to it), as new combinators get periodically proposed for various things and if this gets implemented, we'll be back on square one, having to find a new generic syntax that is backwards compatible or going back to inventing more ASCII art combinators (which makes it very hard to add new combinators and is terrible DX for authors).

This is proposed as a design principle, it's not meant to lock us in for cases where a different syntax makes more sense (e.g. combinators that relate to existing ones (e.g. #12453) might make more sense to have syntax that is reminiscent of the corresponding current combinator).

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