WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.48k stars 4.18k forks source link

Update secondary button appearance #64744

Open jameskoster opened 2 months ago

jameskoster commented 2 months ago

This issue came out of the discussion in https://github.com/WordPress/gutenberg/issues/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 to default, as discussed in https://github.com/WordPress/gutenberg/issues/63856. There's an interesting article on this subject here, the upshot being:

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:

Components  Button - Secondary ⋅ Storybook

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:

example

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):

mono

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:

jameskoster commented 2 months ago

As a starting point for discussion here's a design we might consider:

button

Here's how this design would appear in context:

Screenshot 2024-08-23 at 13 57 57

And to users with monochromatic color blindness:

mono
jameskoster commented 1 month ago

Noting that other style treatments like gradient backgrounds and elevation can greatly improve the distinction between buttons / inputs for users with monochromatic color blindness.

Regular appearance Monochromatic color blindness sim
Screenshot 2024-09-19 at 17 05 05 Screenshot 2024-09-19 at 17 10 46

Compared with trunk it's much clearer at a glance which elements are inputs and which are buttons.

jasmussen commented 1 month ago

@WordPress/gutenberg-design