Re: [csswg-drafts] [selectors] Shouldn't there be a pseudo selector for `:unchecked` inputs? (#10746)

A small consideration that may have been missed: In HTML/JS, `indeterminate` and `checked` states are _not_ mutually exclusive; which means `:indeterminate` can be made to match together with both `:checked` and `:not(:checked)`. It may not be very useful, but you can have "indeterminate checked checkbox" and "indeterminate unchecked checkbox".

<details><summary>You can verify it in the browser console</summary>

```js
const checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.checked = true;
checkbox.indeterminate = true;

checkbox.matches(":checked"); // true
checkbox.matches(":indeterminate"); // true
```

</details> 

If `:unchecked` is made mutually exclusive with `:indeterminate`, it would make things inconsistent.

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


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

Received on Saturday, 12 October 2024 17:07:10 UTC