Skip to content

Rename pseudo-class features with ambiguous names #3436

Open

Description

@foolip

In #3239 (comment) I spotted a few pseudo-classes that maybe should have a "-pseudo" to reduce ambiguity. Our guidelines don't definitely say what to do, but let's consider renaming the following features:

For all of these, appending "-pseudo" would be OK. In a few cases there's already another ID with a disambiguation suffix that it would join, like lang-attr.

cc @ddbeck

Activity

  1. foolip commented on Oct 10, 2025

    @foolip
    CollaboratorAuthor

    If we do this, we should also consider how to avoid future pseudo-class features being disambiguated when they don't need to be. People will copy existing examples, after all.

  2. nt1m commented on Oct 10, 2025

    @nt1m
    Contributor

    I think it would be good to distinguish pseudo-class from pseudo-element too in the name

  3. ddbeck commented on Oct 13, 2025

    @ddbeck
    Collaborator

    I'd support this as a bulk rename, if it were paired with:

    • a guideline for when to include disambiguation text. I suspect we could have a general guideline that says something like:

      If an API is not unique to the platform in general (for example, CSS and HTML features share a name, such as :lang() and the lang attribute), then use a disambiguation suffix (for example, -pseudo or -event or -attr) to distinguish them.

    • an update to the contributor docs (i.e., the from scratch section) that suggests preemptively checking for likely ambiguities (e.g., maybe search for BCD keys that contain the pending feature ID)

  4. ddbeck commented on Oct 13, 2025

    @ddbeck
    Collaborator

    I think it would be good to distinguish pseudo-class from pseudo-element too in the name

    @nt1m are there any cases where we'd need to distinguish between pseudo-class and pseudo-element? My inclination here is to use just enough text to disambiguate. If we're not likely to ever mint a pair foo-pseudo-element and foo-pseudo-class, then the distinction seems unnecessary in the ID itself (i.e., if we'd only ever need to distinguish something like -pseudo and -attr).

  5. foolip commented on Oct 13, 2025

    @foolip
    CollaboratorAuthor

    I think there aren't any existing pseudo-class names that are also pseudo-element names, so I'd be inclined to not disambiguate. Another reason I'd like to avoid this is because has-pseudo-class would read like ":has() pseudo-class", but it's really ":has() functional pseudo-class".

  6. captainbrosset commented on Oct 14, 2025

    @captainbrosset
    Contributor

    Just -pseudo seems enough to me. Getting too far down the path of being very specific risks getting us to a place where hundreds of feature ids end up with -api or -interface, etc. When just the name would have been enough.
    web-features is for web developers: names, descriptions, but also ids should be self-explanatory to them. They tend to say "has" not "has-pseudo", so let's not disambiguate unless we really need to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions