Re: [csswg-drafts] [selectors] Add pseudo-classes for `<select>` being a drop-down box vs a list box (#7422)

+1 to "put `select` in the name" - it means we don't have to figure out whether this also applies to N other things, and verify if new things need to have it, possibly in only certain UAs, etc... Plus the general argument that if it only applies to 1 thing now, people *will* rely on that fact and use it on its own (without a tagname selector) with the intention of targeting `select`s specifically, and that code will then break in the future when we apply it to more. General policy: never use a generic name that *could plausibly* apply to many things unless there are *at least* three things that it *already* applies to.

Relying solely on `:not()` for the non-dropdown case is slightly unfortunate, as it requires you to use the tagname in the selector as well - `select:not(:select-with-dropdown)` - since just `:not(:select-with-dropdown)` will target random elements too. I think we should come up with a name for the other state. I think `listbox` is fine - even if it's a little unclear on its own, since it'll be contrasted with `dropdown` I think it's reasonable.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7422#issuecomment-1208442418 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 8 August 2022 18:06:09 UTC