Skip to content
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

Colour contrast issue with blue links on white or light grey #4011

Closed
selfthinker opened this issue Aug 8, 2024 · 1 comment
Closed

Colour contrast issue with blue links on white or light grey #4011

selfthinker opened this issue Aug 8, 2024 · 1 comment
Labels
accessibility audit july 2024 Issues from July 2024 external accessibility audit against WCAG 2.2 criteria

Comments

@selfthinker
Copy link
Contributor

selfthinker commented Aug 8, 2024

This issue is from the accessibility audit of the Design System website by DAC in July 2024.

DAC's description

Blue on light grey

The colour contrast on the blue link text against the grey background failed to meet the expected ratio to pass WCAG 2.2 AAA. The expected ratio for colour contrast with text should be at least 7:1, however the colour contrast ratio for text within this element is 4.87:1. This may be problematic for visually impaired users.

Foreground: #1D70B8
Background: #F8F8F8
Font Size: 19px
Ratio: 4.87:1

Screenshot of blue links on a light grey background

Current code:

<p class="govuk-body">
  Read the <a href="https://github.com/alphagov/govuk-frontend/releases/tag/v5.4.1" class="govuk-link">full release notes</a> to see what’s changed.
</p>

Blue on white

The colour contrast on the blue link text against the white background failed to meet the expected ratio to pass WCAG 2.2 AAA. The expected ratio for colour contrast with text should be at least 7:1, however the colour contrast ratio for text within this element is 5.17:1. This may be problematic for visually impaired users.

Foreground: #1D70B8
Background: #FFFFFF
Font Size: 19px
Ratio: 5.17:1

Screenshot of blue links on a white background

Current code:

<p class="govuk-body">
  The GOV.UK Design System helps teams that work on government services follow the <a class="govuk-link" href="https://www.gov.uk/guidance/government-design-principles">Government Design Principles</a> and <a class="govuk-link" href="https://www.gov.uk/service-manual">GOV.UK Service
Manual</a>.
  This website also follows the <a class="govuk-link" href="https://www.gov.uk/guidance/style-guide">style guide</a> and <a class="govuk-link" href="https://www.gov.uk/guidance/content-design">content design guidance</a> used by GOV.UK.
</p>

DAC's proposed solution

For sites to meet AAA, they must comply with WCAG 2.2 checkpoint 1.4.6 for colour contrast.
As far as contrast ratio is concerned, it must at least be:

  1. if text is not bold and its size is less than 18pt/24px/1.5em/150%: 7:1 for AAA level
  2. if text is not bold and its size is at least 18pt/24px/1.5em/150%: 4.5:1 for AAA level
  3. if text is bold and its size is less than 14pt/19px/1.2em/118%: 7:1 for AAA level
  4. if text is bold and its size is at least 14pt/19px/1.2em/118%: 4.5:1 for AAA level

Thoughts on solution

This is a known issue (see links under 'related issues').
Making the link colour darker would mean it's harder to distinguish from the surrounding text, which is also an accessibility issue. For that reason we have previously never "fixed" this.

Due to potential upcoming work on colours, we should revisit that decision then.
Related to that, we had checked all of our colour combinations against the upcoming WCAG 3 APCA calculation. That would be worth sharing with the people working on said project.

Related issues

Additional instances

Blue links on white are the standard, so happen on all pages. Blue links on grey only happen sometimes.
If we wanted to fix this, we'd need to check under which circumstances links can be on light grey and fix all of those instances.

Needed roles

Designer

@selfthinker selfthinker added accessibility audit july 2024 Issues from July 2024 external accessibility audit against WCAG 2.2 criteria labels Aug 8, 2024
@kellylee-gds kellylee-gds moved this to Backlog 🏃🏼‍♀️ in GOV.UK Design System cycle board Aug 12, 2024
@selfthinker selfthinker added accessibility concern Bug, feature request or question about the accessibility of a portion of a product (not a WCAG fail) and removed accessibility concern Bug, feature request or question about the accessibility of a portion of a product (not a WCAG fail) labels Dec 5, 2024
@selfthinker
Copy link
Contributor Author

We have decided not to do anything about this at the moment because we plan to work on colours in general soon as part of an upcoming project. As part of that project we will keep this and other colour considerations (like APCA) in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility audit july 2024 Issues from July 2024 external accessibility audit against WCAG 2.2 criteria
Projects
Status: Backlog 🏃🏼‍♀️
Development

No branches or pull requests

1 participant