alphagov / govuk-design-system

One place for service teams to find styles, components and patterns for designing government services.
https://www.gov.uk/design-system
MIT License
514 stars 232 forks source link

Test and document alternative solutions to increasing the font weight #3964

Closed CharlotteDowns closed 3 months ago

CharlotteDowns commented 3 months ago

What

Test and document alternative solutions to increasing the font weight.

Increasing the font weight of the navigation items will:

Why

Users have let us know they find it hard to read, it is also recognised as failing with a new method of measuring colour contrast of text on a background.

Additional context

Issues on alphagov repositories

Done when

CharlotteDowns commented 3 months ago

Testing with Accessible Perceptual Contrast Algorithm (APCA)

Using a APCA calculator to test govuk-colour("blue") #1d70b8 on tints of govuk-colour("light-grey") #f3f2f1 as mentioned in Finalise design, spacing and function.

The font size of a navigation item currently on mobile and desktop is 19px.

Name Background colour Text colour APCA Contrast score Minimum font size for 400 font weight (GDS Transport light) Minimum font size for 700 font weight (GDS Transport bold) Pass on mobile Pass on desktop
Navigation item (on white) #ffffff #1d70b8 75.1 18px 14px Y Y
Navigation item (50% lighter background) #f9f9f8 #1d70b8 71.5 19.5px 14.5px N N
Navigation item (20% lighter background) #f5f5f4 #1d70b8 69.1 20.25px 15px N N
Navigation item (as is) #f3f2f1 #1d70b8 67.5 20.75px 15px N N
Navigation item (with 10% darker text) #f3f2f1 #1a65a6 72.2 19px 14.5px Y Y

Text colour darker than 10% of #1d70b8 will not pass Links with a 3:1 contrast ratio with surrounding text

CharlotteDowns commented 3 months ago

Navigation item (on white)

Pros Cons
doesn't look unusable
  • doesn't stand out as much (which becomes more important with other elements like the 'switcher')
  • users have also found blue on white difficult to read

Navigation item (50% lighter background)

Pros Cons
less WCAG risks (apart from the obvious contrast) perception as white, advantages of it being a different colour to distinguish are lost

Navigation item (20% lighter background)

Pros Cons
less WCAG risks (apart from the obvious contrast)
  • not 25% as styles guidance suggests
  • perception as white, advantages of it being a different colour to distinguish are lost

Navigation item (with 10% darker text)

Could also be done with filter: brightness(.9); combined hex code would be: #1B64A6 (from picker, rough) Pros Cons
  • precedent of doing something similar before with text colours (notification banner, existing header)
  • similar enough that users may not notice
not using a colour that's in our existing colour palette is not best practice