-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update secondary button appearance #64744
Comments
@WordPress/gutenberg-design |
The proposed resting state for the button looks like it has a border using The existing button meets that, but - as you observe - is difficult to distinguish from input styles. I definitely would like to see the button design be more distinct from input design. Would it work if it kept the existing border, and only changed the fill? |
@joedolson Wouldn't the contrast of the background also need to be 3:1 against white to differentiate from inputs? I'm thinking about folks with monochromatic color blindness. My thinking was that a combination of color, font-weight, fill (gradient), and shadow would cover all bases. See the fourth example in this codepen. |
I appreciate the exploration here. That said, I’m not confident in the latest direction. The use of gradients and shadows introduces visual elements that don’t align with other component visuals, and might not directly address the core issues being solved for. I do see potential in the gray fill color and font-weight changes. The text is already centered vs. left aligned, what are some other options? A corner radius change? It could be worth exploring these further in the context of the full interface—toolbar, inspector, and modals—to ensure it balances well across the system. |
The gradient/shadow are mainly to further distinguish secondary buttons from inputs for folks with color blindness, as mentioned in #64744 (comment). But perhaps the weight change and central alignment of text is adequate? Simulation: A subtle background (similar to the hover state for
Probably easiest to try in a PR at this point. Change considerations:
Radius is another option, but could have undesirable knock-on effects (block toolbar). |
It's not clear to me that the gradient adds very much for people with color blindness, as it's so subtle (nowhere near contrast ratios), compared to the text being centered, which is fairly universal. Same with the background and hover states. Not that it can't work, the flat background does use existing design principles. As it is, though, exploring a font weight change seems the most basic changethat can meaningfully differentiate. |
The gradient would be fine for people with color blindness; the contrast ratios are about distinguish between two colors, and have nothing to do with the ability to see colors. Somebody with color blindness would be perfectly able to see that gradient. They are, however, too subtle to be significant for people with reduced contrast vision. I do think that centered text is a strong indicator of the difference between buttons & inputs; adding a font weight change would be an additional subtle clue to help distinguish. |
This issue came out of the discussion in #63856.
There are a couple of details about the secondary button appearance it could be good to address.
Lack of clear hover style
Users with low vision might have difficulty distinguishing buttons from static content. A distinct hover style helps these users identify buttons as interactive elements.
Relatedly, a clear hover style will be critical if the button cursor ever changes from
pointer
todefault
, as discussed in #63856. There's an interesting article on this subject here, the upshot being:pointer
is for links. Note that default browser styles do not apply it tobutton
s,radio
s,input
s, or any other interactive elements.There are also cursor-less environments to keep in mind like Spatial Computing, or devices that use different cursor sets, e.g. an iPad with Magic Keyboard:
Visual overlap with inputs
Text inputs and secondary buttons have a very similar footprint, visual weight, and general style treatment. As an example here's a screenshot from the Block Inspector:
If you squint, or find yourself in certain lighting conditions, it's kind of hard to tell the input / button apart. This is even more pronounced for sufferers of monochromatic color blindness (simulator):
Coupled with the lack of clear hover style this makes for a situationally poor UX.
Additional considerations
It's important to acknowledge that any new design should retain the a11y features of the current design. Specifically:
The text was updated successfully, but these errors were encountered: