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

Explicitly set the text colour for notification banner content, rather than using the user-agent default text colour #2036

Merged
merged 2 commits into from
Nov 25, 2020

Conversation

36degrees
Copy link
Contributor

@36degrees 36degrees commented Nov 25, 2020

The notification banner content currently uses the user agent default text colour.

This means that for users who have not changed their user agent default text colour, the text will be true black (#000000) rather than the ‘GOV.UK’ black we specify in the colour palette (#0b0c0c).

It also means that if a user has changed their default text colour, but has not chosen to override colours, depending on the user’s prefered colour scheme the text may have low contrast or be invisible.

For example, my Firefox instance is configured to use white text on a blue background:

Firefox colour preferences, with 'Text' set to white, 'Background' set to blue, and Unvisited/Visited links set to yellow, and 'Override the colors specified by the page with your selections above' set to 'Never'

The notification banner is therefore white-on-white, and thus invisible:

The notification banner showing invisible text

As I understand it, this is as a ‘failure of Success Criterion 1.4.3, 1.4.6 and 1.4.8 due to specifying foreground colors without specifying background colors or vice versa’.

Set the text colour of the govuk-notification-banner__content element using the govuk-text-colour mixin to fix this:

The fixed notification banner with visible text

Fixes #2037

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-2036 November 25, 2020 11:24 Inactive
The notification banner content currently uses the user agent default text colour.

This means that for users who have not changed their user agent default text colour, the text will be true black (`#000000`) rather than the ‘GOV.UK’ black we specify in the colour palette (`#0b0c0c`).

It also means that if a user has changed their default text colour, but has not chosen to override colours, depending on the user’s prefered colour scheme the text may have low contrast or be invisible. For example, my Firefox instance is configured to use white text on a blue background. The notification banner is therefore white-on-white, and thus invisible. As I understand it, this is as a ‘failure of Success Criterion 1.4.3, 1.4.6 and 1.4.8 due to specifying foreground colors without specifying background colors or vice versa’ [1].

Set the text colour of the `govuk-notification-banner__content` element using the `govuk-text-colour` mixin to fix this.

[1]: https://www.w3.org/TR/WCAG20-TECHS/F24.html
@36degrees 36degrees force-pushed the notification-banner-text-colour branch from 311df07 to 4a350d9 Compare November 25, 2020 12:22
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-2036 November 25, 2020 12:22 Inactive
Copy link
Contributor

@vanitabarrett vanitabarrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this just needs a Changelog entry, then it's good to go

@36degrees 36degrees changed the title Set notification banner text colour Explicitly set the text colour for notification banner content, rather than using the user-agent default text colour Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Content within the notification banner uses the default user-agent text colour
3 participants