Re: [csswg-drafts] [css-forms-1] What does control-value() return for `<input type="checkbox">` (#12368)

Hi @lukewarlow and @valtlai,

I have been following this discussion and agree with the core issue raised: if `control-value()` simply mirrors the `.value` getter for checkboxes/radios, it becomes unusable for practical styling (as Valtlai noted). Since the goal seems to be reflecting user interaction, here are some options:

- Boolean/KW Values: Return true/false or keywords like 'checked'/'unchecked' to directly expose the checked state. This  complements :checked without redundancy.

- Conditional Value: Return the value attribute only when checked (else null/empty), matching form submission.

- Explicit Limitation: If neither approach adds value, clarify in the spec that :checked suffices for these controls.

Key question: What is the intended use case for control-value() here? If it is not meant to reflect selection state, we might need to rethink its design for checkboxes/radios.*

Happy to help explore precedents (e.g., how ARIA or appearance handle this) or test implementations!

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


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

Received on Friday, 20 June 2025 02:58:43 UTC