-
Notifications
You must be signed in to change notification settings - Fork 104
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
Department colours are not always accessible #316
Comments
Hey @edwardhorsford Thanks for raising I've just added a bug card to the Core Format team's planning board over at https://trello.com/c/4QPPRvuy/680-make-sure-all-organisation-colours-are-accessible Thanks for raising 👍 |
Hi @NickColley has there been any progress on this? |
Doesn’t look like it:
|
@NickColley @robinwhittleton can you suggest who I can talk to to try to get this prioritised? Is it Shilpa Acharya? It's been 3 months since I raised this issue - I'd like to get this accessibility issue addressed. |
My guess is that it was marked as low priority. Shilpa is the person to talk to. |
What should the DEFRA and HMRC text colours be? |
Regarding #249, from the ticket it looks like the colour was approved for text but wasn't re-tested:
I vaguely recall it was judged against the large text 3:1 ratio. Large text being 18px or over. Though clearly there's text on the page that's in that colour and at 14px. |
Point taken about large text. I'll @aduggin weigh in for that, but in practice we have been aiming for 4.5:1 or greater for all text. It's hard to control how these colours are used, so IMHO it's easier to aim for the higher contrast and then know it's 'safe' for all type sizes. Since the colour is used below 18px (and moreso on mobile), this is somewhat a moot point - this still needs to be addressed. |
@edwardhorsford I agree. It's good to know how we got it wrong so we don't make the same mistakes again. |
Talking with @accessiblewebuk, large text is actually 18.66px (14pt) for bold and 24px (18pt) for non bold. |
We've prioritised this now, but aren't sure what the new colours should be. |
I've had a go darkening the colours so they meet our 4.5:1 minimum contrast requirement. HMRC is a very minor change, whilst DEFRA is more significant. Guessing these should go as 'websafe' versions whilst leaving the real deparment colour alone. HMRC: #008670 (contrast 4.52:1 from 4.47:1) Examples:HMRC before:HMRC after:Defra before:Defra after: |
NB: I've not audited every department colour. There may be additional departments with issues that haven't been spotted. |
Make sure text colour meets the contrast ratio 4.5:1 to meet WCAG AA standard. https://www.w3.org/TR/WCAG20/#larger-scaledef Discussion: #316
Make sure text colour meets the contrast ratio 4.5:1 to meet WCAG AA standard. https://www.w3.org/TR/WCAG20/#larger-scaledef Discussion: #316
Make sure text colour meets the contrast ratio 4.5:1 to meet WCAG AA standard. https://www.w3.org/TR/WCAG20/#larger-scaledef Discussion: #316
Just going to reopen this since there's potentially more departments that Ed didn't notice, so we should close this once we're confident they're all accessible. |
I'd like to include some automated tests to check each text colour value in this Sass list: https://github.com/alphagov/govuk_frontend_toolkit/blob/master/stylesheets/colours/_organisation.scss#L75 Here's a pure Sass way of calculating colour contrast: It has a method of warning if contrast is below a certain ratio: |
That Sass method is supported by @voxpelli at https://github.com/voxpelli/sass-color-helpers |
@fofr that works if you are sure they are only being used against white (or you have a list of colours they will be used against. Then it need to be made clear in any statement what combinations have been tested. |
@accessiblewebuk definitely worth making a note in the implementation that we're testing against the background colour due to how we're currently using the department colours (which as far as I know is always against our background color) |
Since we support $panel-colour there's an argument to checking all our colours against that - in effect requiring a slightly higher contrast than 4.5:1 - roughly 6:1 from a quick test. |
This is where I got to with a proof of concept on raising Sass warnings. It doesn't currently work because it's not loading in the Sass files from the colour helpers correctly, but it should do what we want: https://github.com/alphagov/govuk_frontend_toolkit/compare/sass-warn |
@fofr You need to add a new govuk_frontend_toolkit/Gruntfile.js Line 49 in ef06147
Adding eg. Also: I just released a new patch version that fixes voxpelli/sass-color-helpers#5, so a good idea to upgrade to version |
Test that all organisation colours have a contrast ratio of 4.5 or greater against white. Error when contrast too low. * Protects against poor colour choices in future * Use sass-color-helpers to provide contrast function https://github.com/voxpelli/sass-color-helpers * Only include colour helpers when in dev, don't package with gem * Store sass test in same directory as generated sass test file * Confirms that all current colours have good contrast ratio * Confirms that old DEFRA colour was poor contrast ratio Fixes #316
PR to protect against poor contrast in the future: |
Several department colours do not have sufficient contrast, and are being used for text.
Example: Defra org page
Departments with issues:
Note I think there's several issues:
contrast-safe
ortext-contrast-safe
colour.web-safe
colour variants to mean contrast safe, but this does not communicate the purpose of the variant, and has led to some being deleted - such as Update defra green #249. Web-safe means something different.Update:
The issue with
web-safe
is that it has a specific meaning. It's also been used to refer to a hex version of another named colour. Such as when an org has a Pantone colour as their brand colour, and a 'web version' for internet use.For our use, all the hex colours can be used on the web, but only some will have suitable contrast for text.
We must meet WCAG 2.0 AA, which requires a contrast against the background of 4.5:1 or greater.
The text was updated successfully, but these errors were encountered: