govuk-frontend
govuk-frontend copied to clipboard
WCAG 2.2: Tab focus state risks failing 2.4.13: Focus appearance
Description of the issue
The tabs component doesn't meet the minimum requirements for WCAG 2.2 criterion 2.4.13: focus appearance under circumstances where tab text is very short. This is because:
- the component uses link decoration with black text, reducing the contrast change between focused and unfocused to meet the criterion
- for "active" tabs (white background) there is no text decoration, reducing the possible area focus area required to meet the criterion
- for "inactive" tabs (grey background) the contrast between the grey background and the focus yellow is too low
Steps to reproduce the issue
See the testing spreadsheet, including the focus appearance pass fail calculator (internal only) for more details on the circumstances where this issue occurs
Further reading
- https://github.com/alphagov/govuk-design-system/issues/3007 - related issue on focus state rationalisation
- https://github.com/alphagov/govuk-frontend/issues/4470 - may inadvertently solve this issue