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 2f6332e72..c48c58083 100644
--- a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
+++ b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.css
@@ -5243,6 +5243,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 2916d94

@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 2916d94

@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.43 KiB 0.1%
packages/govuk-frontend/dist/govuk/govuk-frontend.min.css 125.41 KiB 0.1%

No changes to module sizes.


Action run for 2916d94

@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
27 tasks
@querkmachine querkmachine force-pushed the fix-skiplink-high-contrast-outline branch from d6ab69f to 0dcfb5b Compare November 14, 2025 15:26
@querkmachine querkmachine force-pushed the fix-skiplink-high-contrast-outline branch from 0dcfb5b to c63ab81 Compare November 25, 2025 10:48
@domoscargin domoscargin added this to the v5.14 milestone Dec 4, 2025
@querkmachine querkmachine modified the milestones: v5.14, v6.0 Dec 8, 2025
CHANGELOG.md Outdated

- [#5311: Remove non-operational value parameter from file upload component](https://github.com/alphagov/govuk-frontend/pull/5311)
- [#6434: Fix rebranded header background being visible when printed](https://github.com/alphagov/govuk-frontend/pull/6434) - thanks to @lewis-softwire for reporting this issue
- [#6447: Fix pagination outputting empty links when provided a null or empty value](https://github.com/alphagov/govuk-frontend/pull/6447) – thanks to @NikhilNanjappa for reporting this issue
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we've picked up a stray changelog entry here?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's GONE

Copy link
Contributor

Choose a reason for hiding this comment

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

It is! But I think we've now got some extra service nav stuff

@querkmachine querkmachine force-pushed the fix-skiplink-high-contrast-outline branch from c63ab81 to 218eb90 Compare December 8, 2025 14:49
@querkmachine querkmachine force-pushed the fix-skiplink-high-contrast-outline branch from 218eb90 to 5f00c57 Compare December 8, 2025 14:52
Copy link
Member

@romaricpascal romaricpascal left a comment

Choose a reason for hiding this comment

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

Neat little fix 🙌🏻

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-6445 December 8, 2025 14:53 Inactive
Copy link
Contributor

@domoscargin domoscargin left a comment

Choose a reason for hiding this comment

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

Just popping this in here so we don't merge before we shift the service nav hidden stuff out of this PR

@querkmachine querkmachine force-pushed the fix-skiplink-high-contrast-outline branch from 5f00c57 to f817e79 Compare December 8, 2025 15:03
@querkmachine querkmachine reopened this Dec 8, 2025
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-6445 December 8, 2025 15:05 Inactive
@querkmachine querkmachine merged commit baec1be into main Dec 8, 2025
49 of 58 checks passed
@querkmachine querkmachine deleted the fix-skiplink-high-contrast-outline branch December 8, 2025 15:24
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.

Skip link focus outline gets clipped on 3 sides when using Windows High Contrast Mode

5 participants