You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Button active and focus state needs more distinct styling #127
The contrast difference between active state and normal state is not big enough. Ideally it needs something like a border, inverted colours, underline...
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?
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.
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.
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.
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.
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:
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.
Reacted by Tammie Lister, Mel Choyce-Dwan and Matias Ventura
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.
Great discussion with some really interesting insights, which I think distill down to three (+1) key points:
Accessibility should be designed into the product from the start, not added in later
It's quite challenging to meet accessibility requirements using colour alone - especially in the context of wanting a "light and modern" aesthetic
If colour alone is not enough, we need to use something else - like shape
[optional bonus] The interaction is a little fun :)
So today we had a crack at playing around with something that meets the above criteria: you can interact with it here http://codepen.io/napy84/pen/LWbBrv
It's possibly too much/not the right kind of animation ( discussion on animation style guide here #15 ) to be used on every button, but perhaps if used selectively, like on the block level controls, could be both elegant and provide differentiation from the [selection]-toolbars
Thank you for your endless patience here, @afercia. This is important to get right. It sounds like the following would pass:
But by those rules put out alone it sounds like Google Docs, Office 365, Apple Pages, Sketch would all fail:
That last one is Apple Pages, which achieves a 2.6:1 contrast ratio, the most of them all. But it's still not 3:1.
Can you confirm that all those above fail the accessibility bar, or do they pass through other means? If so, what makes them pass? You mention:
unless we're going to use some additional indicator to distinguish the different states
To me this sounds like a border, or an inset shadow on the active item. But in all of those above, the border itself does not have enough contrast either. Is it the very dark border around the active item in current TinyMCE that makes the current iteration of the editor pass?
Would be good to know which others pass or not. It sounds like inverse colours make it so that appearance is distinct enough from the other buttons.
Even if the others do not pass, it doesn't mean our editor shouldn't, and this is a great area where the WordPress editor can shine, together with all the other improvements we're doing. Like @afercia mentioned, it's a really interesting design challenge, where alternative creative solutions are welcome. Maybe there's a whole new way to design active states. :)
Enter the two colors and the ratio is 1.26:1. Instead, it must be at least 3:1, unless we're going to use some additional indicator to distinguish the different states.
So that means this ones fails:
Luminosity Contrast is 1.46:1
The gradient in this one might be a bit more tricky?
Lighter top Lum Contrast is 2.15:1
Darker bottom Lum Contrast is 3.1:1
But it's also inverting the color, which is more than just changing the background.
I do like this one below the best. But we still need a HOVER state designed.
I think the one with the subtle dark border, the last one posted by @jasmussen would pass 🙂 Also the last one by @mapk 🙂
by those rules put out alone it sounds like Google Docs, Office 365, Apple Pages, Sketch would all fail
I'm really not sure what are their accessibility requirements 🙂
it's a really interesting design challenge, where alternative creative solutions are welcome. Maybe there's a whole new way to design active states. :)
There's a tool to help you know if it passes - a Firefox addon called ainspector. It will likely complain about a lot more than contrast, but if you're diving into accessibility that's a good tool to use in general. It's very picky but so are the standards 😉
The last one by @mapk is what we do in textbox.io which definitely passes.
Activity
mapk commentedon Feb 23, 2017
Current view of 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?

ellatrix commentedon Feb 23, 2017
Trying something as well:
http://webaim.org/resources/contrastchecker/?fcolor=12181e&bcolor=e0e5e9
ellatrix commentedon Feb 23, 2017
ellatrix commentedon Feb 23, 2017
Maybe contrast between two backgrounds is allowed to we smaller though, worth checking.
afercia commentedon Feb 23, 2017
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.
ellatrix commentedon Feb 23, 2017
The contrast between the white background and the grey background is 1.27:1.
afercia commentedon Feb 23, 2017
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 commentedon Feb 23, 2017
Reference about font-size for contrast ratio:
https://www.w3.org/TR/WCAG20-TECHS/G18.html
Still not clear how to apply that to svg icons 😬
mapk commentedon Feb 23, 2017
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.
afercia commentedon Feb 23, 2017
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.
ellatrix commentedon Feb 23, 2017
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.
So it sound like an extra indicator is good, but it hard to know what contrast between backgrounds is actually enough.
jasmussen commentedon Feb 24, 2017
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:
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 commentedon Feb 24, 2017
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.
30 remaining items
anna-harrison commentedon Mar 8, 2017
Great discussion with some really interesting insights, which I think distill down to three (+1) key points:
So today we had a crack at playing around with something that meets the above criteria: you can interact with it here http://codepen.io/napy84/pen/LWbBrv
It's possibly too much/not the right kind of animation ( discussion on animation style guide here #15 ) to be used on every button, but perhaps if used selectively, like on the block level controls, could be both elegant and provide differentiation from the [selection]-toolbars
jasmussen commentedon Mar 8, 2017
Thank you for your endless patience here, @afercia. This is important to get right. It sounds like the following would pass:
But by those rules put out alone it sounds like Google Docs, Office 365, Apple Pages, Sketch would all fail:
That last one is Apple Pages, which achieves a 2.6:1 contrast ratio, the most of them all. But it's still not 3:1.
Can you confirm that all those above fail the accessibility bar, or do they pass through other means? If so, what makes them pass? You mention:
To me this sounds like a border, or an inset shadow on the active item. But in all of those above, the border itself does not have enough contrast either. Is it the very dark border around the active item in current TinyMCE that makes the current iteration of the editor pass?
I am very grateful for your time here.
ellatrix commentedon Mar 8, 2017
Yes, it is. :) Here's the most recent commit for that: WordPress/wordpress-develop@e9f1903
Would be good to know which others pass or not. It sounds like inverse colours make it so that appearance is distinct enough from the other buttons.
Even if the others do not pass, it doesn't mean our editor shouldn't, and this is a great area where the WordPress editor can shine, together with all the other improvements we're doing. Like @afercia mentioned, it's a really interesting design challenge, where alternative creative solutions are welcome. Maybe there's a whole new way to design active states. :)
jasmussen commentedon Mar 8, 2017
Absolutely, did not mean to imply otherwise. 😉
Afraithe commentedon Mar 8, 2017
Googles Material Design could also be a source of inspiration around this I guess.
https://material.io/guidelines/components/buttons.html
jasmussen commentedon Mar 8, 2017
How's this?
That's a 4.8:1 on the contrasts, as far as I can tell.
mapk commentedon Mar 8, 2017
According to @afercia:
So that means this ones fails:
Luminosity Contrast is 1.46:1
The gradient in this one might be a bit more tricky?

Lighter top Lum Contrast is 2.15:1
Darker bottom Lum Contrast is 3.1:1
But it's also inverting the color, which is more than just changing the background.
I do like this one below the best. But we still need a HOVER state designed.

Maybe something like this?

afercia commentedon Mar 8, 2017
I think the one with the subtle dark border, the last one posted by @jasmussen would pass 🙂 Also the last one by @mapk 🙂
I'm really not sure what are their accessibility requirements 🙂
Yay! +1
TheSpyder commentedon Mar 8, 2017
There's a tool to help you know if it passes - a Firefox addon called ainspector. It will likely complain about a lot more than contrast, but if you're diving into accessibility that's a good tool to use in general. It's very picky but so are the standards 😉
The last one by @mapk is what we do in textbox.io which definitely passes.
jasmussen commentedon Mar 29, 2017
Closing as this is solved by the inverted version in the mockups: https://wpcoredesign.mystagingwebsite.com/gutenberg/
Feel free to reopen if this issue surfaces again.
chore: update `codecov` to v3, resolves all `npm audit` issues. (#127)
Packages: Move packages repository into Gutenberg (#7556)
Fixed: Added `stylelint-scss` plugin @if/@else placement rules. (#127)
Add new package `@wordpress/stylelint config` (#22777)