Fix colour contrast of disabled
radio button text
#4744
Merged
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.
We have noticed that when radio buttons have the
disabled
attribute set1, the text does not meet WCAG standards2 for colour contrast. This is true for the label3, and worse for the hint text4:This is caused by some CSS in GOV.UK Frontend5.
I propose:
Which looks like:
Colour alone isn’t used here to differentiate – there is still the semantics of the
disabled
attribute itself, the different cursor behaviour, and the content of the hint text.disabled
is not often the best way to do things (and is not documented in the Design System) but sometimes it’s appropriate$govuk-text-colour
withopacity: .5
applied computes to a value of#858585
, which gives a contrast ratio of 3.69:1 against a white background$govuk-secondary-text-colour
withopacity: .5
applied computes to a value of#a8acae
, which gives a contrast ratio of 2.28:1 against a white backgroundCard: https://trello.com/c/7Q6pMovq/381-fix-contrast-ratio-of-text-and-hint-for-disabled-radio-buttons