gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Button active and focus state needs more distinct styling

Open ellatrix opened this issue 9 years ago • 53 comments

Why? Accessibility. Some people don't see well. 👓

The contrast difference between active state and normal state is not big enough. Ideally it needs something like a border, inverted colours, underline...

http://webaim.org/resources/contrastchecker/

This is the style in core:

screenshot 2017-02-21 19 02 07

ellatrix avatar Feb 23 '17 16:02 ellatrix

Current view of hover state: current-hover-state

Proposed revision: I know there was discussion about the UI being heavy, so I tried to keep this as light as possible. I'm basing it all from the sketch file.

The contrast on the active states is compliant for WCAG 2 AA (18pt+). Does that work in relation to our icons there? hover-state

mapk avatar Feb 23 '17 18:02 mapk

Trying something as well:

screenshot 2017-02-23 19 55 41

http://webaim.org/resources/contrastchecker/?fcolor=12181e&bcolor=e0e5e9

ellatrix avatar Feb 23 '17 18:02 ellatrix

screenshot 2017-02-23 19 59 19

ellatrix avatar Feb 23 '17 18:02 ellatrix

Maybe contrast between two backgrounds is allowed to we smaller though, worth checking.

ellatrix avatar Feb 23 '17 19:02 ellatrix

Contrast ratio can be just 3:1 instead of the usual 4.5:1 for "Large-scale" text, which is text "with at least 18 point or 14 point bold or font size". I'm not sure how to apply this to svg icons :) THey look bold to me, not sure about the font-size.

Adding a shape, even a subtle one, can surely help.

Just as a reminder: controls need also a focus style.

afercia avatar Feb 23 '17 19:02 afercia

The contrast between the white background and the grey background is 1.27:1.

ellatrix avatar Feb 23 '17 19:02 ellatrix

Ah well that. The difference between the two states should be perceivable. That reminds me of https://core.trac.wordpress.org/ticket/28599 where our recommendation is to use an additional indicator, like a shape.

afercia avatar Feb 23 '17 20:02 afercia

Reference about font-size for contrast ratio: https://www.w3.org/TR/WCAG20-TECHS/G18.html

The ratio between sizes in points and CSS pixels is 1pt = 1.333px, therefore 14pt and 18pt are equivalent to approximately 18.5px and 24px.

Still not clear how to apply that to svg icons 😬

afercia avatar Feb 23 '17 20:02 afercia

I believe the svg icons are 24px, so we should be ok. But the lighter grey against the white non-active state is still an issue.

mapk avatar Feb 23 '17 20:02 mapk

Well, the icons rect is 24px. The glyphs inside the rect are smaller :) But as long as they're bold and they don't go under a corresponding font-size of 18.5px they should be ok.

afercia avatar Feb 23 '17 21:02 afercia

The issue is not really the contrast between the icons and the background. That is 👌. The issue's the difference between the normal and active state, the white and light grey background. Which may be enough, I'm not entirely sure about that.

The difference between the two states should be perceivable. That reminds me of https://core.trac.wordpress.org/ticket/28599 where our recommendation is to use an additional indicator, like a shape.

So it sound like an extra indicator is good, but it hard to know what contrast between backgrounds is actually enough.

ellatrix avatar Feb 23 '17 21:02 ellatrix

Good explorations so far. Keep the thoughts coming.

Let's expand our minds, as Ella suggests, and think beyond just color as something that can add contrast. Some other ideas:

formatting click

formatting click 2

formatting click 3

formatting -click-4

Neither of 👆 feel juuust right to me, but we're making progress here. @mapk importantly noted that the blocks were mentioned as feeling heavy, and as soon as we lightened the block borders and used the light white floaty chrome everywhere, the critique subsided. This is important to keep in mind, so we don't regress here.

We have to find a balance between the light UI and proper accessability, and we are on the cusp of it. Keep thinking folks! 🌟 work so far.

jasmussen avatar Feb 24 '17 08:02 jasmussen

Also — this is a UI that has been solved in the past. Let's look at what others have been doing, like Google Docs, Word, Pages, Keynote, any other app or web-app that uses formatting controls like this.

jasmussen avatar Feb 24 '17 09:02 jasmussen

Here's yet another attempt, which still doesn't feel right, but hopefully inspires more experiments:

formatting click

jasmussen avatar Feb 24 '17 09:02 jasmussen

Also — this is a UI that has been solved in the past. Let's look at what others have been doing, like Google Docs, Word, Pages, Keynote, any other app or web-app that uses formatting controls like this.

And WordPress 😉

screenshot 2017-02-24 10 21 16

Google Docs ^

screenshot 2017-02-24 10 25 47

Apple Pages ^

ellatrix avatar Feb 24 '17 09:02 ellatrix

Anyway, let's not dig too deep into this issue, there are larger problems to solve. :)

ellatrix avatar Feb 24 '17 09:02 ellatrix

The old TinyMCE look is very dated at this point, and very heavy looking. This on its own is not a reason to change it, but since we are doing a lot of modernization elsewhere in the UI, the time to modernize is now, make sure it fits the "language" of the rest of the optimizations we are making.

The splash of color that Pages adds seems worth exploring! There's a lot of gray in the UI already. The best color person I know in the whole world is @hugobaeta — if I may borrow a minute of your time (please ❤️ ) — is this a place where we can introduce an accent color to the default blue? I know you have some accent colors in your codepen...

jasmussen avatar Feb 24 '17 10:02 jasmussen

More inspiration. Note, my posting these is not an endorsement — some of these are terrible.

Here's what Adobe Spark does:

screen shot 2017-02-18 at 15 04 56

Here's what Dropbox Paper does:

screen shot 2017-02-24 at 11 20 16

Here's what Facebook notes does:

screen shot 2017-02-24 at 11 27 37

Here's what Google Sites does:

screen shot 2017-02-24 at 11 31 35

Here's what LivingDocs does:

screen shot 2017-02-24 at 11 35 14

This is what Medium does:

screen shot 2017-02-24 at 11 36 01

This is what notion does:

screen shot 2017-02-24 at 11 37 34

Quip:

screen shot 2017-02-24 at 11 39 31

Squarespace:

screen shot 2017-02-24 at 11 40 11

Weebly:

screen shot 2017-02-24 at 11 41 34

Wix, sort of:

screen shot 2017-02-24 at 11 42 18

jasmussen avatar Feb 24 '17 10:02 jasmussen

Some more ideas:

screen shot 2017-03-01 at 9 22 57 pm screen shot 2017-03-01 at 9 24 26 pm

melchoyce avatar Mar 02 '17 02:03 melchoyce

Inversion of colors ^^ could help :) Noting the active state should be clear for all controls, so maybe this issue should be extended to other parts of the UI?

screen shot 2017-03-02 at 08 41 59

afercia avatar Mar 02 '17 07:03 afercia