Update govuk-frontend to v6.2.0#5964
Merged
Merged
Conversation
Move $path and $govuk-frontend-supported-css-class variables into config and then @use them where needed. While @import made everything globally available, @use doesn't. Remove @import './url-helpers' from mains.scss and directly @use it in needed partials. Remove `$govuk-new-link-styles: true;` as that was deprecated in v5.
Then @use it in govuk-frontend/overrides
Use @forward to pass styles from govuk-frontendto main.scss for compilation when @use. It turns out that ``` @use "govuk/base" as * with ( $govuk-assets-path: "/static/" ); ``` needs to be in main.scss otherwise compiler just outputs an emtpy chunk. Overrides and extensions also need to `@use "govuk/base (or helpers)" as *` in their files. Turns out you can't just have that higher up where these files get @used.
Migrate to @use
Migrate to @use
Migrate to @use
Migrate to @use
Migrate to @use Most partils require `@use 'govuk/helpers'` and some require specific settings.
Since there is no more global scope, we need to move things elsewhere and import them directly. Since `get-govuk-typography-style` might be reused in the future, it's been moved into _helpers.scss from /govuk-frontend/extensions.scss and imported into message.scss
Logical place to put it and then import it where needed.
Migrate to @use and use what partials need from govuk-frontend.
Migrate to @use
Common place for shared helpers that get imported directly into partials.
Tools was missing, but compiler threw no error.
in govuk-frontend/overrides
b916c8f to
c818e0d
Compare
tombye
approved these changes
Jun 17, 2026
tombye
left a comment
Contributor
There was a problem hiding this comment.
It takes a while to get your head round @use and @forward but the commits helped and this all looks good to me. I also checked all the core journeys and didn't find anything wrong 👍🏻
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
govuk-frontend 6.2.0 release notes
What and why
This updates the library which brings in the use of @use and @forward in Sass as a replacement for
@import.As
@importwill be deprecated, we need to migrate to@useourselves in our codebase, which is being done here.Changes here are minimal, but they do move some things around. Personal choices, so happy to be challenged on them.
Reviewing
Changes have been broken down by logical commits, so hopefully reviewing each commit will be easier.
I've checked major user flows for any visual glitches.
Diff between 6.1 with @import and v6.20 with @use unminified