Closed jonathanconway closed 7 years ago
Just echoing what I noted in slack—
imho:
:hover
, :focus
, and :active
… and balancing all three can be hard. :)Hmm... I can imagine an :active state being useful for, say, a toggle-button.
~Update:~
~New design guide buttons also don't entirely conform to WCAG, in terms of colour contrast.~
~Regular buttons conform to AA but not AAA.~ ~Disabled buttons conform to neither AA nor AAA.~
Deleted. Government isn't required to support AAA and disabled buttons are actually black on grey, which passes AAA.
buttons need a visible indication when they receive keyboard focus - this can be a distinct colour change (at least a 3:1 contrast difference between focus/non-focus states, while still maintaining the text:background contrast of 4.5:1) or an additional indicator like a border or pattern - https://www.w3.org/WAI/WCAG20/quickref/#qr-navigation-mechanisms-focus-visible See also
Just adding some more bg info on the direction in 2.x:
I’m closing this unless there are objections to re-open.
Just to also note - all color changes need to be checked against color blindness as well as contrast
(no need to reopen - just adding to my a11y note)
Cheers all
At the moment colour is the only way of visually distinguishing a focussed button from a non-focussed button.
From tracing back the variables, it seems like there is at most a 10% colour difference (in terms of lightness) between regular button state and hover button state.
See below:
Should we either increase the contrast or add an additional visual marker of focused-ness, e.g. a border?