You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rename pseudo-class features with ambiguous names #3436
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.
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.
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)
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).
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".
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.
Activity
foolip commentedon Oct 10, 2025
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.
nt1m commentedon Oct 10, 2025
I think it would be good to distinguish pseudo-class from pseudo-element too in the name
ddbeck commentedon Oct 13, 2025
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:
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)
ddbeck commentedon Oct 13, 2025
@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-elementandfoo-pseudo-class, then the distinction seems unnecessary in the ID itself (i.e., if we'd only ever need to distinguish something like-pseudoand-attr).foolip commentedon Oct 13, 2025
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".captainbrosset commentedon Oct 14, 2025
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.