GOV.UK Frontend 6.0.0-beta #6353
owenatgov
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
v6.0.0-beta.1 (Beta breaking release)
Breaking changes
Use the
govuk-functional-colourfunction to access functional (formerly applied) colours in SassWe've renamed and restructured our applied colours in Sass, and we've changed how you access them in your own code. They are now called functional colours.
If you were using the value of one of the variables in
settings/_colours-applied.scss, use the newgovuk-functional-colourfunction to output avar()call referencing the colour.govuk-functional-colourcall$govuk-brand-colourgovuk-functional-colour(brand)$govuk-text-colourgovuk-functional-colour(text)$govuk-template-background-colourgovuk-functional-colour(template-background)$govuk-body-background-colourgovuk-functional-colour(body-background)$govuk-print-text-colourgovuk-functional-colour(print-text)$govuk-secondary-text-colourgovuk-functional-colour(secondary-text)$govuk-focus-colourgovuk-functional-colour(focus)$govuk-focus-text-colourgovuk-functional-colour(focus-text)$govuk-error-colourgovuk-functional-colour(error)$govuk-success-colourgovuk-functional-colour(success)$govuk-border-colourgovuk-functional-colour(border)$govuk-input-border-colourgovuk-functional-colour(input-border)$govuk-hover-colourgovuk-functional-colour(hover)$govuk-link-colourgovuk-functional-colour(link)$govuk-link-visited-colourgovuk-functional-colour(link-visited)$govuk-link-hover-colourgovuk-functional-colour(link-hover)$govuk-link-active-colourgovuk-functional-colour(link-active)Although we've now deprecated the Sass variables, they're still available to make your migration easier.
However, if your code was using the Sass variables to do computations using the Sass colour API, a compilation error will occur. This is because the variables now store a Sass string with a
var()call, rather than a Sass colour.Use
$govuk-functional-coloursto redefine functional (formerly applied) coloursWe've restructured our applied colours in Sass. They are now called functional colours, and we've changed the way you redefine them.
If you were redefining a custom value for the functional colour before importing GOV.UK Frontend, you can still do this by assigning a map of the colours you want to change to the
$govuk-functional-coloursvariable.Note that you can only redefine existing functional colours, not add new functional colours. This is to make sure there's a clear separation between colours from GOV.UK Frontend and colours from your own project.
We've ended support for Ruby Sass and LibSass
GOV.UK Frontend no longer supports Ruby Sass or LibSass. You must update your project to Dart Sass to continue using GOV.UK Frontend.
Support for Ruby Sass ended in 2019, and LibSass was deprecated in 2020. A number of Sass implementations, including Node Sass, SassC and sass-rs, are dependent upon LibSass. GOV.UK Frontend no longer supports these implementations.
The Sass developers have provided guides for:
We made this change in pull request #6311: Remove support for Ruby Sass and LibSass.
We've set our minimum Dart Sass version to 1.79
GOV.UK Frontend will no longer support services using Dart Sass versions earlier than 1.79. If you're using an earlier version of Dart Sass, your service's Sass may break, as GOV.UK Frontend may use features in Dart Sass that are not available in earlier versions.
If you're using an earlier version of Dart Sass than 1.79, see the Dart Sass releases and follow their release notes to upgrade to version 1.79 or later to continue using GOV.UK Frontend.
We made this change in pull request #6366: Update Dart Sass tests minimum version to 1.79.0.
Update references to
govuk-pagination__item--ellipsesclass from the HTML for the Pagination componentWe deprecated the
govuk-pagination__item--ellipsesclass in GOV.UK Frontend 5.13.0, and we've now removed it.If you're not using Nunjucks macros, you should update instances of this class to use the
govuk-pagination__item--ellipsisclass instead.If you're using Nunjucks macros, you don't need to change anything.
We made this change in pull request #6382: Remove deprecated
govuk-pagination__item--ellipsesclass.Update the class on the GOV.UK logo link in the Header component
We've updated the value of the
classattribute on the link to the GOV.UK homepage togovuk-header__homepage-link.If you're not using Nunjucks macros, you'll need to update this class manually.
We made this change in pull request #6423: Remove service name and navigation from Header component.
Stop including the service name and navigation items in the Header component
We deprecated including the service name and navigation in the Header in GOV.UK Frontend 5.9.0.
We've now removed this functionality.
Service names and service-level navigation should now use the Service navigation component.
We made this change in pull request #6423: Remove service name and navigation from Header component.
Stop importing GOV.UK Frontend's Sass using
allWe deprecated GOV.UK Frontend's
all.scssfile and partials in GOV.UK Frontend 5.8.0 and replaced them with equivalent Sassindexfiles. We've now removed theall.scssfiles entirely.With the move to Dart Sass, you can now simplify how you import Sass from GOV.UK Frontend.
We made this change in pull request #6412: Remove
all.scssfile and partials.Update to the new organisation colour palette
We updated the organisation colour palette in GOV.UK Frontend 5.9.0.
The new palette was initially opt-in using the
$govuk-new-organisation-coloursfeature flag. The updated palette is now the only palette available, so you can remove the feature flag from your code.As part of this work, we removed the deprecated
$websafeparameter of thegovuk-organisation-colourfunction. Use the$contrast-safeparameter when calling the function instead.We made this change in pull request #6390: Remove legacy organisation colour palette.
Update references to deprecated organisations in the organisation colour palette
We've removed deprecated organisations from the organisation colour palette. These organisations had ceased to exist or had been renamed prior to the start of 2025.
We made this change in pull request #6426: Remove deprecated organisation colours.
Stop using the
govuk-responsive-typographySass mixinWe renamed the
govuk-responsive-typographySass mixin togovuk-font-sizein GOV.UK Frontend 5.1.0. We've now removed the previous name entirely.We made this change in pull request #6387: Remove
govuk-responsive-typographymixin.Stop using the
--govuk-frontend-breakpointCSS custom propertiesWe renamed CSS custom properties starting
--govuk-frontend-breakpointto begin with--govuk-breakpointin GOV.UK Frontend 5.11.0. We've now removed the previous names for these properties.We made this change in pull request #6385: Remove
--govuk-frontend-breakpointCSS properties.Remove references to the
$govuk-show-breakpointsfeature flagThe
$govuk-show-breakpointsfeature flag was deprecated and rendered non-operational by the media query changes introduced in GOV.UK Frontend 5.13.0.This flag was only intended for use as a local development aid and not for production services, and we've now removed it.
We made this change in pull request #6384: Remove
$govuk-show-breakpointsfeature flag.Stop using the
elementparameter of the Button componentWe deprecated the
elementparameter of the Button component Nunjucks macro in GOV.UK Frontend 5.1.0, and we've now removed it.The component is now output as a link if the
hrefparameter is set. Otherwise, it's abuttonelement.This means it's no longer possible to use
inputelements for buttons. Buttons usinginputare less flexible thanbuttonelements in terms of styling and content allowed within them, so we want to avoid using them.We made this change in pull request #6383: Remove element parameter from Button component.
Stop using
$govuk-canvas-background-colourWe renamed
$govuk-canvas-background-colourto$govuk-template-background-colourin GOV.UK Frontend 5.10.0. We've now removed the previous variable entirely.We made this change in pull request #6413: Remove
$govuk-canvas-background-colour.Stop using St. Edward's Crown and the
useTudorCrownparameterGOV.UK updated its logo to replace the St. Edward's Crown with the Tudor Crown in GOV.UK Frontend 5.1.0. The Tudor Crown became the default in 5.2.0, which is when we deprecated the option to switch between crowns.
We've now removed the Header component's
useTudorCrownparameter and assets relating to the St. Edward's Crown.We made this change in pull request #6414: Remove
useTudorCrownparameter and St. Edwards crown assets.Stop using
govuk-body-xs,govuk-!-font-size-14and '14' as a possible font size ingovuk-fontWe deprecated 14 as a point on our type scale in GOV.UK Frontend 5.1.0. We've now removed it as an option, along with the typography classes that used it:
govuk-body-xsgovuk-!-font-size-14We made this change in pull request #6417: Remove 14 from the type scale.
We've updated our responsive type scale
We updated our responsive type scale behind the feature flag
$govuk-new-typography-scalein GOV.UK Frontend 5.2.0.These type scale changes are now on by default, and we've removed the
$govuk-new-typography-scalefeature flag.We made this change in pull request #6421: Turn the new type scale on by default.
Recommended changes
Rename turquoise and pink coloured tags
We've renamed 2 of the Tag component's colour modifier classes to be in line with GOV.UK Frontend's new colour palette:
govuk-tag--turquoiseis nowgovuk-tag--tealgovuk-tag--pinkis nowgovuk-tag--magentaRename your tags to reflect these changes, as we'll be removing
govuk-tag--turquoiseandgovuk-tag--pinkin a future breaking release.We made this change in pull request #6416: Deprecate turquoise and pink tag colour modifiers.
Check that the GOV.UK logo links to the GOV.UK homepage
We've updated the default value of
homepageUrlto point to the GOV.UK homepage.The previous default value pointed at the root of the current domain. On services, this caused the GOV.UK logo to link to the homepage of the service, rather than the GOV.UK homepage.
Unless you operate a GOV.UK branded product, the GOV.UK logo should always link to the homepage of GOV.UK. Use the Service navigation component to provide a link to a local homepage.
We made this change in pull request #6418: Update default
homepageUrlto point to GOV.UK homepage.New features
The GOV.UK footer component now allows the removal of OGL Content Licence information
If your service does not provide information under the Open Government Licence (OGL), you can now remove it from the GOV.UK footer.
If you're using Nunjucks, set the
contentLicenceparameter tofalse:We made this change in #6191: Allow removal of Content Licence information in the GOV.UK footer component. Thanks to @NickColley for making this change.
Fixes
Tags now have borders for improved legibility
We've reviewed the design of the tag component in response to changes from the new GOV.UK brand colour palette.
Tags now have a 1px border, with the colour based on the background colour of the tag. This makes tags easier to distinguish against white backgrounds.
We made this change in pull request #6379: Add borders to tags.
Other fixes
We've made fixes to GOV.UK Frontend in the following pull requests:
v6.0.0-beta.0 (Beta breaking release)
To install this version with npm, run
npm install [email protected]. You can also find more information about how to stay up to date in our documentation.Breaking changes
Use GOV.UK brand colours
We’ve updated GOV.UK Frontend to use the web palette defined by the GOV.UK Brand guidelines, as well as the 25% and 50% shades when they exist for a given colour.
Check your service’s colours
Our components now use the colours of the GOV.UK web palette. If you’re using any custom colours, you’ll need to make sure they still work well with the new web palette in terms of accessibility and design. If possible, you should use the GOV.UK brand colours instead.
Use the
govuk-colourfunction to access GOV.UK brand coloursYou can use the
govuk-colourfunction to fetch colours from the GOV.UK web palette. This function allows you to access both primary colours and their variants, such as tints and shades.When the function receives only the colour name, it’ll return the primary variant of that colour. For example:
Use the new
$variantparameter of thegovuk-colourfunction to access the tints and shades of a colour defined by the GOV.UK brand.You can find the list of possible colour names in the GOV.UK brand guidelines.
If you’re already using the
govuk-colourfunctionIf you’re already using the
govuk-colourfunction in your project, colours from the GOV.UK web palette will now be applied automatically when you call the function.If the colour name exists in the GOV.UK web palette, the function returns the primary variant for that colour. The colour remains the same for
‘blue,yellowandorange, but the following colours will see a slight change:green#00703c#11875ared#d4351c#ca3535purple#4c2c92#54319fbrown#b58840#99704aSome of the GOV.UK brand colours are slightly different from the colours that were returned by
govuk-colourbefore GOV.UK Frontend v6.0. That means you’ll need to check that the colours still work correctly where you applied them in your project, in terms of accessibility and design.To make it easier to upgrade, in cases where a colour name does not exist in the GOV.UK brand palette (for example,
bright-purple), the function will return the closest colour from the GOV.UK brand palette but produce a deprecation warning. We recommend that you update your calls togovuk-colourwith deprecated colour names to use a colour from the GOV.UK brand, such as the one suggested in the deprecation warning message.govuk-colournow maps colour names that no longer exist from the old palette to the new palette, as described in the following table. You can use this list to assess and update your use ofgovuk-colour.light-pink#f499be#e59abepink#d53880#ca357clight-green#85994b#4da583turquoise#28a197#158187light-blue#5694ca#5694cadark-blue#003078#0f385clight-purple#6f72af#7f65b7bright-purple#912b88#98285ddark-grey#505a5f#484949mid-grey#b1b4b6#cececelight-grey#f3f2f1#f3f3f3If you’re using the
$govuk-coloursvariableWe’ve removed the
$govuk-coloursvariable from GOV.UK Frontend, to only allow access to the colours through thegovuk-colourfunction.If you were accessing the GOV.UK Frontend colours with
map-get($govuk-colours, <COLOUR_NAME>), you’ll now need to usegovuk-colour(<COLOUR_NAME>).We made these changes in the following pull requests:
govuk-colourgovuk_palettegovuk_palettegovuk_paletteStop using the
$legacyparameter in thegovuk-colourfunctionWe’ve removed the
$legacyparameter of thegovuk-colourfunction, so you should remove any usage of it.We made this change in pull request #6326: Use brand palette through
govuk-colour.Stop using
govuk-tintandgovuk-shadeThe
govuk-tintandgovuk-shadefunctions for applying tints and shades to colours by percentage are now deprecated and no longer work. They now only return the colour you pass to them, as well as a Sass warning. We’ll remove thegovuk-tintandgovuk-shadefunctions in the final release of 6.0.0.We recommend replacing them with tints and shades from the new GOV.UK colour palette that are as close as possible to your existing implementation.
We made this change in pull request #6341: Deactivate
govuk-tintandgovuk-shadefunctions.Fixes
We've made fixes to GOV.UK Frontend in the following pull requests:
Beta Was this translation helpful? Give feedback.
All reactions