Update default web content style of radio buttons and checkboxes
Categories
(Core :: Widget, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox136 | --- | fixed |
People
(Reporter: juliana, Assigned: emilio)
References
Details
Attachments
(6 files)
After discussing this with various people we decided to update the style of our web-content checkboxes and radio buttons.
The changes boil down to this:
- Reduce border width from 2px to 1px for both
- Checked radio buttons should have a single white circle in the center
I don't know how feasible this is, but it'd be also nice if our checkmark looked less jagged. Let me know if I can help with that in any way!
| Reporter | ||
Comment 1•1 year ago
|
||
| Reporter | ||
Comment 2•1 year ago
|
||
Hello!
We had another discussion around this and rounded out the proposed changes for the focus outline, which are:
- The default style should match how
outline-style: autolooks like today. 2px accent color border and then a 1px white border - For our radio buttons and checkboxes, we need a special case where first there is a 2px white border followed by a 2px accent color border
| Reporter | ||
Updated•1 year ago
|
| Assignee | ||
Comment 3•1 year ago
|
||
why 2px + 2px? It'd be nice to keep the outline offsets consistent...
| Assignee | ||
Comment 4•1 year ago
|
||
So changing the border width is trivia, patch attached.
But I'd be skeptic about changing the checked appearance because it makes distinguishing <input type=radio> from <input type=radio checked disabled> quite hard, IMHO. wdyt?
| Assignee | ||
Comment 5•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 6•1 year ago
|
||
| Assignee | ||
Comment 7•1 year ago
|
||
Another question is how should the single-dot version render at different sizes, e.g.:
data:text/html,<input type=radio checked style="width: 50px; height: 50px;"><input type=radio checked style="width: 6px; height: 6px">
I went for half the checkbox size and I think it looks nice and that also solves comment 4 (as the checked border is much thicker).
| Assignee | ||
Comment 8•1 year ago
|
||
I'll land that for now so you can see how it looks next nightly, we can tweak the 2px + 2px outline if you want in a follow-up, same for the dot thing (or we can always back out)
Comment 10•1 year ago
|
||
Backed out for causing reftest failures @ checkbox-clamp-01.html
- Backout link
- Push with failures
- Failure Log
- Failure line:
REFTEST TEST-UNEXPECTED-FAIL | layout/reftests/forms/input/checkbox/checkbox-clamp-01.html == layout/reftests/forms/input/checkbox/checkbox-clamp-01-ref.html | image comparison, max difference: 1, number of differing pixels: 3
Comment 11•1 year ago
|
||
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Comment 13•1 year ago
|
||
Comment 15•1 year ago
|
||
Comment 16•1 year ago
|
||
Backed out 6 changesets (Bug 1941755) for causing wr3 failures @ transform-input-018.html
Failure log
Failure line:
TEST-UNEXPECTED-FAIL | /css/css-transforms/transform-input-018.html | Testing http://web-platform.test:8000/css/css-transforms/transform-input-018.html == http://web-platform.test:8000/css/css-transforms/transform-input-018-ref.html
Comment 17•1 year ago
|
||
Comment 18•1 year ago
|
||
Also these type of failures: https://treeherder.mozilla.org/logviewer?job_id=490365850&repo=autoland&lineNumber=25628
Comment 20•1 year ago
|
||
| Reporter | ||
Comment 21•1 year ago
|
||
Sorry I just noticed that I put my message for bug 1941755 in here too (comment 2) 😔 But looks like you figured it out!
The new focus outline for text inputs looks great! Thank you!!
Re your comments:
why 2px + 2px? It'd be nice to keep the outline offsets consistent...
I would also love to keep them consistent just worry about DPR 1 screens where the white border inside gets kind of swallowed. I attached a screenshot. What do you think?
But I'd be skeptic about changing the checked appearance because it makes distinguishing <input type=radio> from <input type=radio checked disabled> quite hard, IMHO. wdyt?
I went for half the checkbox size and I think it looks nice and that also solves comment 4 (as the checked border is much thicker).
Having the inner white circle be 50% of the blue circle looks good!
I'm not sure I understand your concern with the disabled state. In the screenshot I also added how I mocked up the radio buttons in Figma, is that not what they are going to look like? Or am I missing something?
Comment 22•1 year ago
|
||
Backed out for causing reftest failure on radio-clamp-01.html
| Assignee | ||
Comment 23•1 year ago
|
||
Gah, sorry, I misread the failure above and thought it was the checkbox-clamp subtest, not radio-clamp :(
Third time's the charm.
Comment 24•1 year ago
|
||
Comment 25•1 year ago
|
||
Comment 26•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/6ddca6904545
https://hg.mozilla.org/mozilla-central/rev/95af8fcb06d6
https://hg.mozilla.org/mozilla-central/rev/67ac7d561312
Comment 27•1 year ago
•
|
||
We heavily use radio buttons in our company webUI. Now it is harder to see it even on white background.
Please revert it or all company have to move to Chrome-based browsers, that displays radio-buttons in classic way.
Why anyone would change radio-button design, that was ages around and is de-facto a standard for all browsers? :-/
Comment 28•1 year ago
|
||
Comment 29•1 year ago
|
||
| Reporter | ||
Comment 30•1 year ago
|
||
Hey Eugene, thanks for the feedback! We know UI changes can take some getting used to, and I appreciate you sharing your concerns.
I’ve just filed bug 1952998 to adjust the design by making the white circle smaller so the blue stands out more—hopefully, that helps with visibility.
To anwer your other question: The update was made to better align with how radio buttons look in native UI across Windows, macOS, and Linux. Chrome’s version isn’t actually the “classic” look. This change also improves some accessibility aspects, particularly around focus states.
We’re not planning to revert to the old design, but I would like to better understand any specific issues you’re having, so I can see if there are any further adjustments that would make sense.
Appreciate you taking the time to share your thoughts!
Description
•