Skip to content

Conversation

@querkmachine
Copy link
Member

@querkmachine querkmachine commented Nov 13, 2025

As skiplinks are typically displayed at the top of the viewport and at full width, the outline style we apply to links in forced-colors mode is clipped on all sides except for the bottom, making it more difficult to see that the link is currently focused.

Fixes #4100.

Changes

  • Adds a negative outline-offset when forced-colors mode is active, so that the outline is visibly rendered within the bounds of the skip link.

Screenshots

Before After
Screenshot of the top of a GOV.UK page in dark forced colours mode, with the skiplink focused, showing the outline on the bottom only. Screenshot of the top of a GOV.UK page in dark forced colours mode, with the skiplink focused, showing the outline on all four sides.
@querkmachine querkmachine self-assigned this Nov 13, 2025
@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Stylesheets changes to npm package

diff --git a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css index 741b02be4..8ef16de92 100644 --- a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css +++ b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css @@ -5242,6 +5242,12 @@ screen and (forced-colors:active) { background-color: var(--_govuk-focus-colour, #fd0) } +@media (forced-colors:active) { + .govuk-skip-link:focus { + outline-offset: -3px + } +} + .govuk-skip-link-focused-element:focus { outline: none } 

Action run for 0dcfb5b

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Other changes to npm package

diff --git a/packages/govuk-frontend/dist/govuk/components/skip-link/_index.scss b/packages/govuk-frontend/dist/govuk/components/skip-link/_index.scss index 29de7864f..bfefeee4f 100644 --- a/packages/govuk-frontend/dist/govuk/components/skip-link/_index.scss +++ b/packages/govuk-frontend/dist/govuk/components/skip-link/_index.scss @@ -24,6 +24,10 @@ outline-offset: 0; background-color: govuk-functional-colour(focus); + @media (forced-colors: active) { + outline-offset: (0 - $govuk-focus-width); + } + // Undo unwanted changes when global styles are enabled @if $govuk-global-styles { @include govuk-link-decoration; 

Action run for 0dcfb5b

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

📋 Stats

File sizes

File Size Percentage change
dist/govuk-frontend-development.min.css 125.4 KiB 0.1%
packages/govuk-frontend/dist/govuk/govuk-frontend.min.css 125.39 KiB 0.1%

No changes to module sizes.


Action run for 0dcfb5b

@querkmachine querkmachine force-pushed the fix-skiplink-high-contrast-outline branch from 420dfe1 to 777ecef Compare November 13, 2025 12:36
@querkmachine querkmachine requested a review from a team November 13, 2025 12:49
@querkmachine querkmachine marked this pull request as ready for review November 13, 2025 12:49
@querkmachine querkmachine changed the base branch from support/5.x to main November 13, 2025 16:38
@querkmachine querkmachine force-pushed the fix-skiplink-high-contrast-outline branch from 777ecef to d5f50df Compare November 13, 2025 16:58
@querkmachine querkmachine force-pushed the fix-skiplink-high-contrast-outline branch from d5f50df to d6ab69f Compare November 13, 2025 16:59
@querkmachine querkmachine mentioned this pull request Nov 14, 2025
23 tasks
As skiplinks are usually present right at the top of the viewport and at full width, the outline style we apply to links in forced-colors mode is clipped on three of the four sides. This commit changes the outline-offset in forced-colors so that it is visible within the bounds of the skip link.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants