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
I am requesting a new selector in CSS4: selector:ifchecked(input-id)
Which will match all elements by selector only if checkbox or radio button with id input-id is checked.
Motivation is following:
Consider code <label for="abc">Test</label><input type="checkbox" id="abc">
where I need to emphasize label with bold when checkbox is selected. With CSS3 it is not possible. It will possible with CSS4 selector :has(#abc:checked) label[for="abc"]. However, :has selector will have perfomance problems (and because of that, possibly, will be never implemented). Requested selector will not have perfomance problems, because it behaves like normal selector, but with additional check whether corresponding checkbox/radio button is checked (which have average complexity O(1)).
The text was updated successfully, but these errors were encountered:
I am requesting a new selector in CSS4:
selector:ifchecked(input-id)
Which will match all elements by
selector
only if checkbox or radio button with idinput-id
is checked.Motivation is following:
Consider code
<label for="abc">Test</label><input type="checkbox" id="abc">
where I need to emphasize label with bold when checkbox is selected. With CSS3 it is not possible. It will possible with CSS4 selector
:has(#abc:checked) label[for="abc"]
. However,:has
selector will have perfomance problems (and because of that, possibly, will be never implemented). Requested selector will not have perfomance problems, because it behaves like normal selector, but with additional check whether corresponding checkbox/radio button is checked (which have average complexity O(1)).The text was updated successfully, but these errors were encountered: