Explicitly set the text colour for notification banner content, rather than using the user-agent default text colour #2036
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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’.
Set the text colour of the
govuk-notification-banner__content
element using thegovuk-text-colour
mixin to fix this:Fixes #2037