Skip to content

Update govuk-frontend to v6.2.0#5964

Merged
kr8n3r merged 18 commits into
mainfrom
update-govuk-frontend-to-620
Jun 18, 2026
Merged

Update govuk-frontend to v6.2.0#5964
kr8n3r merged 18 commits into
mainfrom
update-govuk-frontend-to-620

Conversation

@kr8n3r

@kr8n3r kr8n3r commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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 @import will be deprecated, we need to migrate to @use ourselves 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

kr8n3r added 10 commits June 15, 2026 11:15
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 and add @use "govuk/base" as *
to partials.
Migrate to @use
Most partils require `@use 'govuk/helpers'` and
some require specific settings.
@kr8n3r kr8n3r changed the title Update govuk -frontend to v6.2.0 Update govuk-frontend to v6.2.0 Jun 15, 2026
kr8n3r added 7 commits June 15, 2026 16:42
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.
Common place for shared helpers that get
imported directly into partials.
Tools was missing, but compiler threw no error.
in govuk-frontend/overrides
@kr8n3r kr8n3r force-pushed the update-govuk-frontend-to-620 branch from b916c8f to c818e0d Compare June 15, 2026 15:42
@tombye tombye self-assigned this Jun 17, 2026

@tombye tombye left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 👍🏻

@kr8n3r kr8n3r merged commit a9e43d0 into main Jun 18, 2026
8 checks passed
@kr8n3r kr8n3r deleted the update-govuk-frontend-to-620 branch June 18, 2026 08:03
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.

2 participants