-
Notifications
You must be signed in to change notification settings - Fork 327
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
Investigate colour contrast issues with secondary text colour #1134
Comments
Closed issue as its in the done column on the Kanban board |
Reopening this again, as it was mentioned by a designer in HMRC, in the context of heading captions. |
@dashouse, @DebsDee and I had a conversation about this. This secondary text colour is used in two places:
The worry about increasing the contrast of this colour is that the distinction between the label and the hint text would be lost. This means that to solve this problem it would require representing the hierarchy of the page without colour, for example investigating using bigger or bold text. |
Using increased font sizeIncreasing font-size on hint text will also mean increasing size of checkbox and radio text, when paired with hints to maintain visual hierarchy. Below, the first hint has been scaled up, but the second hasn't. Hint text is used as captions, scaling it up would mean scaling header text to maintain the right ratio, but this doesn't solve the issue mentioned above on when hint text is used to checkboxes and radio buttons text. Increasing font weightThis works better for hint captions: But not so much for input hint text Using tintsDarken hint text by 20% using a sass function as used on buttons, Differences are subtle but effective, the first hint text below has been darkened, the second remains unchanged (for comparison). |
The secondary grey colour's primary purpose is to give it a lower hierarchy in the page compared to labels and legends (headings). By making that colour darker it makes the text more readable which solves the issues around readability, I imagine it's controversial to add a new darker grey to the colour palette, it could also be argued that a darker grey is too close to the body colour and therefore means the visual hierarchy is lost. I'd be interested what @dashouse 's thoughts are on adding a darker grey. When it comes to using bold and increased font size, I think by applying them to the hint itself it could make the hint seem higher in the hierarchy than the labels. If we we're to explore that maybe it could be done by moving the distinction to the label which would allow for the colour distinction to be removed from the hint text. Using increased size for labelsUsing bold for labelsBold seems to be clearer to me personally, and also is a pattern we already use in more complicated forms: Passport examplehttps://design-system.service.gov.uk/patterns/question-pages/#page-headings How do you want to sign in examplehttps://design-system.service.gov.uk/components/radios/#radio-items-with-hints I'm not sure how easy it is to broadly apply this logic, error messages and small inputs using bold could be a problem. |
|
@NickColley Looked into this with @36degrees and found readability is marginally improved (for the Ron persona) by removing anti-aliasing from the hint text. Whether this is something we'd want to do is another question. With antialiasingWithout antialiasing |
Some options discussed for improving the secondary text contrast issue include:
We’re not completely sure how users with visual impairments are impacted by this issue, one recommendation would be to get more information on the range of issues faced by these users before deciding on which (if any) of the options above should be implemented. A suggestion has been to use the upcoming accessibility research on Pay to find out more on this issue. |
I think there's definitely something in all of these options, but my personal preference is to try and make things just a little bit better without having to change how people do anything for the moment. It might be a technical breaking change, but should be a "do nothing" breaking change. I think darkening I'd prefer to change the So a PR for this would be on https://github.com/alphagov/govuk-frontend/blob/master/src/govuk/settings/_colours-palette.scss#L63
Not shutting down any of the other options, but I think this would be an easy ship with some immediate benefit. |
@dashouse I agree, feels like the least invasive option with the biggest trade-off. As @NickColley mentioned, there might be places where bolding labels could reduce content hierarchy in some contexts, thus creating some design debt. Updating the grey, rather than adding a tint makes sense too. |
Fixes in this PR The secondary text colour value has been updated to improve the constrast of components that use the ```govuk-colour("dark-grey")``` sass variable. The value has been updated from ```#6f777b``` to ```626a6e``` Fixes #1134
Fixes in this PR The secondary text colour value has been updated to improve the contrast of components that use the ```govuk-colour("dark-grey")``` sass variable. The value has been updated from ```#6f777b``` to ```#626a6e``` This is a small incremental change that improves the contrast ratio from 4.56:1 to 5.51:1. Fixes #1134
This was accidentally included in the changelog entry for Frontend 3.3.0, but we haven't shipped it yet. Have put it back on the board. |
What
The hint and caption text uses grey (
#6f777b
) against white (#ffffff
), which technically at 4.6:1 meets WCAG 2.1 AA standards for contrast but has been flagged as potentially problematic for users for with visual impairments and elderly user groups.Why
This was flagged in an audit of the design system (5th June 2018):
The text was updated successfully, but these errors were encountered: