Skip to content

GOV.UK Frontend v5.8.0

Latest
Compare
Choose a tag to compare
@owenatgov owenatgov released this 09 Jan 11:52
· 10 commits to main since this release
9b78915

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.

New features

Use our base configurable component to build your own configurable component

We've added a ConfigurableComponent class to help you build your own configurable components. It extends our Component class and allows you to focus on your components' specific features by handling these shared behaviours across components:

  • checking that GOV.UK Frontend is supported
  • checking that the component is not already initialised on its root element
  • checking the type of the root element and storing it for access within the component as this.$root
  • taking a configuration object as a parameter and then storing it for access within the component as this.config
  • merging a passed configuration object with configuration options specified on the data attributes of the root element

We introduced this change in:

Deprecated features

Importing Sass using govuk/all

You'll see a warning when compiling your Sass if you import all of GOV.UK Frontend's styling using govuk/all. Importing using the all file is deprecated, and we’ll remove it in the next major release.

In your import statements, use a trailing /index rather than /all to load GOV.UK Frontend's files:

  • @import "govuk/index"; instead of @import "govuk/all";

You do not need /index at the end of each import path if you’re using Dart Sass.

This change was introduced in pull request #5518: Deprecate govuk/all.scss and only reference govuk/index.scss internally.

Fixes

We've made fixes to GOV.UK Frontend in the following pull requests: