-
Notifications
You must be signed in to change notification settings - Fork 757
Description
Currently the :checked and :indeterminate pseudo-classes can apply to a <input type="checkbox" />:
https://drafts.csswg.org/selectors/#checked
https://drafts.csswg.org/selectors/#indeterminate
But to apply styles for an unchecked checkbox, you must use :not(:checked).
Regarding other selectors there is always a negative variant:
https://drafts.csswg.org/selectors/#enabled-pseudo
https://drafts.csswg.org/selectors/#disabled-pseudo
https://drafts.csswg.org/selectors/#required-pseudo
https://drafts.csswg.org/selectors/#optional-pseudo
https://drafts.csswg.org/selectors/#valid-pseudo
https://drafts.csswg.org/selectors/#invalid-pseudo
https://drafts.csswg.org/selectors/#user-valid-pseudo
https://drafts.csswg.org/selectors/#user-invalid-pseudo
[...]
Having very specific design rules, it feels a bit off and somehow degrades readability:
input:enabled:checked { ... }
input:enabled:checked:hover { ... }
input:enabled:not(:checked) { ... }
input:disabled:checked { ... }
input:disabled:not(:checked) { ... }So for convenience: why don't we have an :unchecked ?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status