Skip to content

Latest commit

 

History

History
5192 lines (3261 loc) · 262 KB

CHANGELOG.md

File metadata and controls

5192 lines (3261 loc) · 262 KB

Changelog

For advice on how to use these release notes see our guidance on staying up to date with changes.

Unreleased

5.4.0 (Feature 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.

This release includes new features to help you include only the components your service uses. Doing this can help reduce the size of the JavaScript and CSS files sent to users, improving their experience.

New features

Create individual components with createAll

We've added a new createAll function that lets you initialise specific components in the same way that initAll does.

The createAll function will:

  • find all elements in the page with the corresponding data-module attribute
  • instantiate a component object for each element
  • catch errors and log them in the console
  • return an array of all the successfully instantiated component objects.
import { createAll, Button, Checkboxes } from 'govuk-frontend'

createAll(Button)
createAll(Checkboxes)

You can also pass a config object and a scope within which to search for elements.

You can find out more about how to use the createAll function in our documentation.

This change was introduced in pull request #4975: Add createAll function to initialise individual components.

Use tabular numbers easily with govuk-!-font-tabular-numbers

We've added a new override class for tabular number styling: govuk-!-font-tabular-numbers.

Using tabular numbers can make it easier for users to read numbers intended for comparison to one another, or for numbers that dynamically update.

It was previously only possible to use tabular numbers by using the govuk-font-tabular-numbers Sass mixin.

This change was introduced in pull request #4973: Add override class for tabular numbers.

Deprecated features

Importing layers using all files

You'll see a warning when compiling your Sass if you import any of our layers using the all file. Importing using the all files is deprecated, and we’ll remove them in the next major release.

Update your import statements to refer to the index file for each layer rather than all:

@import "node_modules/govuk-frontend/dist/govuk/base";
@import "node_modules/govuk-frontend/dist/govuk/core/index";
@import "node_modules/govuk-frontend/dist/govuk/objects/index";
@import "node_modules/govuk-frontend/dist/govuk/components/index";
@import "node_modules/govuk-frontend/dist/govuk/utilities/index";
@import "node_modules/govuk-frontend/dist/govuk/overrides/index";

You do not need /index at the end of each import path if you’re using Dart Sass, LibSass 3.6.0 or higher, or Ruby Sass 3.6.0 or higher.

This change was introduced in pull request #4955: Rename all files to index for our Sass entry points.

Fixes

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

5.3.1 (Fix 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.

Fixes

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

5.3.0 (Feature 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.

New features

Use the Password input component to help users accessibly enter passwords

The Password input component allows users to choose:

  • whether their passwords are visible or not
  • to enter their passwords in plain text

This helps users use longer and more complex passwords without needing to remember what they've already typed.

This change was introduced in pull request #4442: Create password input component. Thanks to @andysellick for the original contribution.

Recommended changes

Update the HTML for the Character count component

We've updated the HTML for the Character count component. The component wrapper data-module="govuk-character-count" and its form group class="govuk-form-group" are now combined as the same <div>. The hint text used as the count message now appears directly after the <textarea>.

If you're not using Nunjucks macros, then you should:

  • move all classes and attributes from the form group <div> to the component wrapper <div>
  • remove the opening <div> and closing </div> tags used by the form group
  • check the count message is now directly after the <textarea>

The following example shows some HTML and the difference once it’s updated.

HTML before:

<div class="govuk-character-count" data-module="govuk-character-count" data-maxlength="100">
  <div class="govuk-form-group">
    <!-- // Label, hint, error and textarea -->
  </div>
  <!-- // Count message -->
</div>

HTML after:

<div class="govuk-form-group govuk-character-count" data-module="govuk-character-count" data-maxlength="100">
  <!-- // Label, hint, error, textarea and count message -->
</div>

Check your changes against the Character count example in the Design System to make sure you’ve correctly implemented them.

This change was introduced in pull request #4566: Use Character count formGroup as module wrapper.

Remove redundant role attributes from elements

We've made minor changes to the HTML of the page template, as well as the header, footer and pagination components.

You can update your HTML to remove the role attribute from some elements. These include the:

  • main role on the main element in the template
  • banner role on the header element in the Header component
  • contentinfo role on the footer element in the Footer component
  • navigation role on the nav element in the Pagination component

These roles were present to support legacy browsers, such as older versions of Internet Explorer. GOV.UK Frontend no longer supports these browsers, so you can now remove these roles.

You do not need to change anything if you're using the Nunjucks versions of the page template or these components,

This change was introduced in pull request #4854: Remove redundant role attributes.

Fixes

We've fixed an upstream issue in the cssnano npm package that caused elements with transparency to render incorrectly in Internet Explorer 11. This affected the pre-compiled CSS files in the GOV.UK Frontend npm package and GitHub releases for versions 5.0, 5.1 and 5.2. This was fixed in:

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

5.2.0 (Feature release)

In this release, we’ve adjusted our responsive type scale, which is available behind a feature flag. The type scale change is to make text easier to read on smaller screens. We’ve also deprecated the useTudorCrown parameter.

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

We've adjusted our responsive type scale

We've made the following adjustments to our responsive type scale:

  • point 16 now returns 16px across all screen sizes
  • point 19 now returns 19px across all screen sizes
  • point 24 remains as 24px on large screens
  • point 24 now returns 21px on small screens instead of 18px and has a line height 25px instead of 20px
  • point 27 remains as 27px on large screens
  • point 27 now returns 21px on small screens instead of 18px and has a line height 25px instead of 20px
  • point 36 remains as 27px on large screens
  • point 36 now returns 27px on small screens instead of 24px and has a line height 30px instead of 25px

To enable these changes, set the feature flag variable $govuk-new-typography-scale to true before you import GOV.UK Frontend in your Sass files:

// application.scss
$govuk-new-typography-scale: true;
@import "govuk-frontend/all";

If your service uses custom elements made using GOV.UK Frontend, test your service against the new typography scale to assess if you need to make any adjustments.

You can read more on upgrading your service to the new type scale in our upgrade guide.

This change was introduced in pull request #2421: Adjust the responsive type scale

Insert custom HTML into component form group wrappers

You can now insert custom HTML into form group wrappers for all components with form fields.

govukInput({
  formGroup: {
    beforeInput: {
      html: "example"
    },
    afterInput: {
      html: "example"
    },
  }
})

This change was introduced in pull request #4567: Add beforeInput(s) and beforeInput(s) options to form groups.

Deprecated features

Stop using the useTudorCrown parameter in the Heading component

The rollout for the revised GOV.UK logo has started and the Tudor crown logo is now shown by default. We’ve deprecated the useTudorCrown parameter and will remove it in the next major release.

You can now remove the useTudorCrown parameter, along with any other adjustments made to display the Tudor crown logo in your service.

This change was introduced in pull request #4740: Make Tudor Crown logo the default

Fixes

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

5.1.0 (Feature 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.

New features

Update to the new GOV.UK logo

The GOV.UK logo has been updated to reflect the changing of the monarch. King Charles III uses the Tudor Crown, rather than the St Edward’s Crown chosen by Queen Elizabeth II.

If your service uses GOV.UK branding, you must update your service between 19 February and 1 March 2024 to use the new logo.

These changes were made in the following pull requests:

Include the new logo assets

Multiple new image assets are included in this release. You’ll need to copy these to your service's image assets folder if they’re not being used directly from the Frontend package. By default this folder is located at /assets/images.

If you’re using Nunjucks, the asset path may have been changed by the assetPath global variable or assetsPath parameter on the header component.

Copy the following files from /dist/assets/images into your assets folder. Any images with the same name as an existing image can be safely overwritten.

  • favicon.ico
  • favicon.svg
  • govuk-icon-180.png
  • govuk-icon-192.png
  • govuk-icon-512.png
  • govuk-icon-mask.svg
  • govuk-opengraph-image.png

Update the logo in the header of your page

If you’re using the govukHeader Nunjucks macro in your service, add the useTudorCrown parameter to the macro instantiation. This will become the default in a future version of GOV.UK Frontend.

{{ govukHeader({
  ...
  useTudorCrown: true
}) }}

If you’re not using the Nunjucks macro, locate the SVG code for the existing logo and replace it with this updated SVG.

<svg
  focusable="false"
  role="img"
  class="govuk-header__logotype"
  xmlns="http://www.w3.org/2000/svg"
  viewBox="0 0 148 30"
  height="30"
  width="148"
  aria-label="GOV.UK"
>
  <title>GOV.UK</title>
  <path d="M22.6 10.4c-1 .4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s-.1 2-1 2.4m-5.9 6.7c-.9.4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s-.1 2-1 2.4m10.8-3.7c-1 .4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s0 2-1 2.4m3.3 4.8c-1 .4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s-.1 2-1 2.4M17 4.7l2.3 1.2V2.5l-2.3.7-.2-.2.9-3h-3.4l.9 3-.2.2c-.1.1-2.3-.7-2.3-.7v3.4L15 4.7c.1.1.1.2.2.2l-1.3 4c-.1.2-.1.4-.1.6 0 1.1.8 2 1.9 2.2h.7c1-.2 1.9-1.1 1.9-2.1 0-.2 0-.4-.1-.6l-1.3-4c-.1-.2 0-.2.1-.3m-7.6 5.7c.9.4 2-.1 2.4-1 .4-.9-.1-2-1-2.4-.9-.4-2 .1-2.4 1s0 2 1 2.4m-5 3c.9.4 2-.1 2.4-1 .4-.9-.1-2-1-2.4-.9-.4-2 .1-2.4 1s.1 2 1 2.4m-3.2 4.8c.9.4 2-.1 2.4-1 .4-.9-.1-2-1-2.4-.9-.4-2 .1-2.4 1s0 2 1 2.4m14.8 11c4.4 0 8.6.3 12.3.8 1.1-4.5 2.4-7 3.7-8.8l-2.5-.9c.2 1.3.3 1.9 0 2.7-.4-.4-.8-1.1-1.1-2.3l-1.2 4c.7-.5 1.3-.8 2-.9-1.1 2.5-2.6 3.1-3.5 3-1.1-.2-1.7-1.2-1.5-2.1.3-1.2 1.5-1.5 2.1-.1 1.1-2.3-.8-3-2-2.3 1.9-1.9 2.1-3.5.6-5.6-2.1 1.6-2.1 3.2-1.2 5.5-1.2-1.4-3.2-.6-2.5 1.6.9-1.4 2.1-.5 1.9.8-.2 1.1-1.7 2.1-3.5 1.9-2.7-.2-2.9-2.1-2.9-3.6.7-.1 1.9.5 2.9 1.9l.4-4.3c-1.1 1.1-2.1 1.4-3.2 1.4.4-1.2 2.1-3 2.1-3h-5.4s1.7 1.9 2.1 3c-1.1 0-2.1-.2-3.2-1.4l.4 4.3c1-1.4 2.2-2 2.9-1.9-.1 1.5-.2 3.4-2.9 3.6-1.9.2-3.4-.8-3.5-1.9-.2-1.3 1-2.2 1.9-.8.7-2.3-1.2-3-2.5-1.6.9-2.2.9-3.9-1.2-5.5-1.5 2-1.3 3.7.6 5.6-1.2-.7-3.1 0-2 2.3.6-1.4 1.8-1.1 2.1.1.2.9-.3 1.9-1.5 2.1-.9.2-2.4-.5-3.5-3 .6 0 1.2.3 2 .9l-1.2-4c-.3 1.1-.7 1.9-1.1 2.3-.3-.8-.2-1.4 0-2.7l-2.9.9C1.3 23 2.6 25.5 3.7 30c3.7-.5 7.9-.8 12.3-.8m28.3-11.6c0 .9.1 1.7.3 2.5.2.8.6 1.5 1 2.2.5.6 1 1.1 1.7 1.5.7.4 1.5.6 2.5.6.9 0 1.7-.1 2.3-.4s1.1-.7 1.5-1.1c.4-.4.6-.9.8-1.5.1-.5.2-1 .2-1.5v-.2h-5.3v-3.2h9.4V28H55v-2.5c-.3.4-.6.8-1 1.1-.4.3-.8.6-1.3.9-.5.2-1 .4-1.6.6s-1.2.2-1.8.2c-1.5 0-2.9-.3-4-.8-1.2-.6-2.2-1.3-3-2.3-.8-1-1.4-2.1-1.8-3.4-.3-1.4-.5-2.8-.5-4.3s.2-2.9.7-4.2c.5-1.3 1.1-2.4 2-3.4.9-1 1.9-1.7 3.1-2.3 1.2-.6 2.6-.8 4.1-.8 1 0 1.9.1 2.8.3.9.2 1.7.6 2.4 1s1.4.9 1.9 1.5c.6.6 1 1.3 1.4 2l-3.7 2.1c-.2-.4-.5-.9-.8-1.2-.3-.4-.6-.7-1-1-.4-.3-.8-.5-1.3-.7-.5-.2-1.1-.2-1.7-.2-1 0-1.8.2-2.5.6-.7.4-1.3.9-1.7 1.5-.5.6-.8 1.4-1 2.2-.3.8-.4 1.9-.4 2.7zM71.5 6.8c1.5 0 2.9.3 4.2.8 1.2.6 2.3 1.3 3.1 2.3.9 1 1.5 2.1 2 3.4s.7 2.7.7 4.2-.2 2.9-.7 4.2c-.4 1.3-1.1 2.4-2 3.4-.9 1-1.9 1.7-3.1 2.3-1.2.6-2.6.8-4.2.8s-2.9-.3-4.2-.8c-1.2-.6-2.3-1.3-3.1-2.3-.9-1-1.5-2.1-2-3.4-.4-1.3-.7-2.7-.7-4.2s.2-2.9.7-4.2c.4-1.3 1.1-2.4 2-3.4.9-1 1.9-1.7 3.1-2.3 1.2-.5 2.6-.8 4.2-.8zm0 17.6c.9 0 1.7-.2 2.4-.5s1.3-.8 1.7-1.4c.5-.6.8-1.3 1.1-2.2.2-.8.4-1.7.4-2.7v-.1c0-1-.1-1.9-.4-2.7-.2-.8-.6-1.6-1.1-2.2-.5-.6-1.1-1.1-1.7-1.4-.7-.3-1.5-.5-2.4-.5s-1.7.2-2.4.5-1.3.8-1.7 1.4c-.5.6-.8 1.3-1.1 2.2-.2.8-.4 1.7-.4 2.7v.1c0 1 .1 1.9.4 2.7.2.8.6 1.6 1.1 2.2.5.6 1.1 1.1 1.7 1.4.6.3 1.4.5 2.4.5zM88.9 28 83 7h4.7l4 15.7h.1l4-15.7h4.7l-5.9 21h-5.7zm28.8-3.6c.6 0 1.2-.1 1.7-.3.5-.2 1-.4 1.4-.8.4-.4.7-.8.9-1.4.2-.6.3-1.2.3-2v-13h4.1v13.6c0 1.2-.2 2.2-.6 3.1s-1 1.7-1.8 2.4c-.7.7-1.6 1.2-2.7 1.5-1 .4-2.2.5-3.4.5-1.2 0-2.4-.2-3.4-.5-1-.4-1.9-.9-2.7-1.5-.8-.7-1.3-1.5-1.8-2.4-.4-.9-.6-2-.6-3.1V6.9h4.2v13c0 .8.1 1.4.3 2 .2.6.5 1 .9 1.4.4.4.8.6 1.4.8.6.2 1.1.3 1.8.3zm13-17.4h4.2v9.1l7.4-9.1h5.2l-7.2 8.4L148 28h-4.9l-5.5-9.4-2.7 3V28h-4.2V7zm-27.6 16.1c-1.5 0-2.7 1.2-2.7 2.7s1.2 2.7 2.7 2.7 2.7-1.2 2.7-2.7-1.2-2.7-2.7-2.7z"></path>
</svg>

Add attributes to component form group wrappers

You can now add attributes to the form group wrapper for all components with form fields.

govukRadios({
  formGroup: {
    attributes: {
      "data-attribute": "value"
    }
  }
})

This change was introduced in pull request #4565: Allow attributes option on form groups.

Use tabular numbers with the govuk-font-tabular-numbers mixin

You can now use tabular numbers in your authored Sass by including the new govuk-font-tabular-numbers mixin.

Previously, you’d use the govuk-font mixin with the $tabular parameter. However, the govuk-font mixin includes styles unrelated to tabular numbers, which are not needed in some contexts.

These additional styles are not included if you use govuk-font-tabular-numbers. Switching to the new mixin can reduce the size of your compiled CSS without affecting the appearance of pages.

This change was introduced in pull request #4307: Refactor tabular number activation into their own mixin.

Recommended changes

Replace instances of govuk-typography-responsive with govuk-font-size

We've renamed the Sass mixin govuk-typography-responsive to govuk-font-size and have deprecated govuk-typography-responsive. You can still use govuk-typography-responsive, but we'll remove it in a future breaking release (GOV.UK Frontend v6.0.0).

This is an experimental change to see if the name govuk-font-size better communicates the Sass mixin's intended use than the name govuk-typography-responsive.

We're interested in feedback from the community on this name change, so please let us know what you think through our usual channels.

This change was introduced in pull request #4291: Rename govuk-typography-responsive to govuk-font-size.

Remove the aria-labelledby attribute from accordion sections

If you’re not using our Nunjucks macros, remove the aria-labelledby attribute from all accordion sections (div elements that have the govuk-accordion__section-content class).

This change was introduced in pull request #4628: Remove aria-labelledby from accordion sections.

Deprecated features

Stop using the element parameter on buttons

We’ve deprecated the element Nunjucks parameter and will remove it in the next major release.

In the future, if the href parameter is set the component will automatically use the <a> element. If the href parameter is not set the component will automatically use the <button> element. It will not be possible to override this change.

This change was introduced in pull request #4646: Deprecate element parameter on button component.

Stop using govuk-body-xs, govuk-!-font-size-14 and '14' on the type scale

We’ve deprecated point 14 (14px large screens, 12px small screens) on the GOV.UK Frontend responsive type scale, including font override classes that use point 14:

  • govuk-body-xs
  • govuk-!-font-size-14

We’ll remove these classes and point 14 on the type scale in the next major release, GOV.UK Frontend release v6.0.0. With this change in the v6.0.0 release, you’ll no longer be able to call the Sass mixins govuk-font or govuk-font-size with $size set to '14'.

This change was introduced in #4649: Deprecate 14 on the type scale and #4713: Ensure govuk-font-size() handles string keys.

Fixes

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

5.0.0 (Breaking release)

You can find a summary of the main changes to GOV.UK Frontend v5 on the Frontend site. It's important to note our old frameworks (such as GOV.UK Elements) are no longer compatible with this release. It also stops Internet Explorer 11 from running GOV.UK Frontend JavaScript and removes support completely for Internet Explorer 8 to 10.

Your service will not stop working in Internet Explorer 11, but components will look and behave differently without JavaScript. Read more about how we provide support for different browsers.

Service teams should be using a progressive enhancement approach to make sure users can still access any content and complete their tasks.

If you still need to provide support for older versions of Internet Explorer, you should stay on the latest GOV.UK Frontend v4 release.

If you need it, we have a checklist for the changes you might need to make for v5, which you can view or copy (needs a Google account).

Breaking changes

You must make the following changes when you migrate to this release, or your service might break.

Update package file paths for Sass

In preparation for additional build targets, we've moved our package files into a directory called dist.

Replace govuk-frontend/govuk with govuk-frontend/dist/govuk in any Sass @import paths.

For example:

@import "node_modules/govuk-frontend/dist/govuk/all";

If you've added node_modules/govuk-frontend as a Sass import path, update it with the /dist suffix:

loadPaths: [
  'node_modules/govuk-frontend/dist'
]

If you're building your Sass code through Rails Assets Pipeline or Sprockets, refer to the section 'Update package file paths in Rails Assets Pipeline or Sprockets'.

Refer to the detailed guidance on importing using Sass.

These changes were introduced in #3498: Remove built dist and package from source

Update package file paths for Nunjucks

In preparation for additional build targets, we've moved our package files into a directory called dist.

Replace govuk-frontend with govuk-frontend/dist in any nunjucks.configure() search paths:

nunjucks.configure([
  'node_modules/govuk-frontend/dist'
])

Refer to the detailed guidance on using Nunjucks.

These changes were made in the following pull requests:

Update package file paths for assets such as images and fonts 

In preparation for additional build targets, we've moved our package files into a directory called dist.

If you're serving the assets from the GOV.UK Frontend assets folder (node_modules/govuk-frontend/govuk/assets), update your routing to the new assets path : node_modules/govuk-frontend/dist/govuk/assets.

Refer to the detailed guidance on importing assets.

These changes were introduced in #3498: Remove built dist and package from source

Update package file paths in Rails Assets Pipeline or Sprockets

In preparation for additional build targets, we've moved our package files into a directory called dist.

Update the  node_modules/govuk-frontend part of the path to node_modules/govuk-frontend/dist, if you've added the path to GOV.UK Frontend package inside node_modules to:

These changes were introduced in #3498: Remove built dist and package from source

Update package file paths if including JavaScript directly

In preparation for additional build targets, we've moved our package files into a directory called dist.

If you've set up your routing to serve GOV.UK Frontend's all.js file from node_modules, update the path you're serving to node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.

Update any <script> tag with the new path and filename, if necessary. Make sure they have a type="module" attribute. For example:

<script type="module" src="{path-to-javascript}/govuk-frontend.min.js"></script>

Replace <script>window.GOVUKFrontend.initAll()</script> to import and initialise GOV.UK Frontend using ES modules:

<script type="module">
  import { initAll } from '{path-to-javascript}/govuk-frontend.min.js'

  initAll()
</script>

Refer to the detailed guidance on importing JavaScript.

These changes were introduced in #3498: Remove built dist and package from source

Update package file paths for Node.js and other bundlers

In preparation for additional build targets, we've moved our package files into a directory called dist.

If you're importing GOV.UK Frontend using import ... from 'govuk-frontend' or require('govuk-frontend'), you have nothing to change.

If you're using import to import individual components, replace govuk-frontend/govuk with govuk-frontend/dist/govuk. For example:

import Button from 'govuk-frontend/dist/govuk/components/button/button.mjs'

If you're using require to import individual components, replace govuk-frontend/govuk with govuk-frontend/dist/govuk and update the file name to <COMPONENT_NAME>.bundle.js. For example:

const Button = require('govuk-frontend/dist/govuk/components/button/button.bundle.js')

Refer to the detailed guidance on importing JavaScript.

These changes were introduced in #3498: Remove built dist and package from source

Verify your code does not rely on polyfills we have now removed

We have removed polyfills for Internet Explorer 8 to 11:

  • DOMTokenList, Element.prototype.classList, Element.prototype.closest, Element.prototype.matches, and Event - required for Internet Explorer 11 and below
  • Element.prototype.dataset - required for Internet Explorer 10 and below
  • Date.now, Document, Element, Element.prototype.nextElementSibling, Element.prototype.previousElementSibling, Function.prototype.bind, Object.defineProperty, String.prototype.trim and Window - required for Internet Explorer 8

However, because these polyfills create or extend global objects ('polluting the global namespace'), you might have other code in your service unintentionally relying on the inclusion of these polyfills. You might need to introduce your own polyfills or rewrite your JavaScript to avoid using the polyfilled features.

These changes were introduced in pull request #3570: Remove Internet Explorer 8 to 10 JavaScript polyfills, helpers, config

Stop Internet Explorer 11 and other older browsers running unsupported JavaScript

Add type="module" to all HTML <script> tags that include or bundle GOV.UK Frontend.

This is to stop Internet Explorer 11 and other older browsers running the JavaScript, which relies on features older browsers might not support and could cause errors.

Please note that <script> with type="module" runs JavaScript in a slightly different way than <script> without `type="module". You'll need to assess the impact of these nuances and make sure that:

  • when your service code is bundled with GOV.UK Frontend it runs as expected in strict mode
  • if you have any code that needs to run after GOV.UK Frontend in its own <script> tag, you'll need to make sure it's using type="module" or defer. This is because the tag loading GOV.UK Frontend will be deferred because of its type="module" attribute
  • code that needs to run without being deferred, is split into its own file and loaded with a <script> tag without type="module"

If your service has JavaScript you want to run successfully in Internet Explorer (for example JavaScript for analytics), you will need to load it in a separate <script> tag without type="module" and make sure its code is compatible with the browsers it should run in (see previous section about polyfills).

These changes were introduced in pull request #3720: Remove IE11 vendor polyfills

Update the <script> snippet at the top of your <body> tag

Page templates now include a new govuk-frontend-supported class on the <body> tag when GOV.UK Frontend JavaScript components are fully supported.

If you are not using our Nunjucks page template, replace the existing snippet:

<script>document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');</script>

with:

<script>document.body.className += ' js-enabled' + ('noModule' in HTMLScriptElement.prototype ? ' govuk-frontend-supported' : '');</script>

These changes were introduced in [pull request #3801:

Add class .govuk-frontend-supported for ES modules support] (alphagov#3801)

Update the hash used by your Content Security Policy

If your Content Security Policy uses a hash to let the snippet above run, you'll need to update it from:

sha256-+6WnXIl4mbFTCARd8N3COQmT3bJJmo32N8q8ZSQAIcU=

to:

sha256-GUQ5ad8JK5KmEWmROf3LZd9ge94daqNvd8xy9YS1iDw=

These changes were introduced in [pull request #3801:

Add class .govuk-frontend-supported for ES modules support] (alphagov#3801)

Remove calls to component init methods from your JavaScript

If you instantiate individual components, remove any calls to component init methods,  as initialisation now happens automatically. If you initialise the JavaScript using window.GOVUKFrontend.initAll(), you will not need to make any changes.

For example, the following:

new Radios($radio).init()

becomes:

new Radios($radio)

This change was introduced in pull request #4011: Remove component init() methods and initialise in constructor.

Remove Internet Explorer 8 stylesheets, settings and mixins

We no longer support Internet Explorer 8 (IE8) in GOV.UK Frontend or provide dedicated stylesheets for the browser. Remove any references to these stylesheets from your HTML.

We've removed the govuk-if-ie8 and govuk-not-ie8 mixins, and the $govuk-is-ie8 and $govuk-ie8-breakpoint settings. These were deprecated in GOV.UK Frontend v4.6.0.

You should:

  • remove calls to the govuk-if-ie8 mixin entirely (because the code passed to the mixin was only ever for Internet Explorer 8)
  • replace calls to the govuk-not-ie8 mixin with the contents that were previously passed to the mixin (because now we always want the code passed to the mixin)
  • verify your codebase no longer uses these mixins and variables
  • remove ie8 from the $govuk-suppressed-warnings list, if present

If a library you depend on is not yet updated and relies on these mixins and variables, as a temporary workaround you can define the following mixins and variables before importing:

$govuk-is-ie8: false;
$govuk-ie8-breakpoint: ('desktop');
@mixin govuk-if-ie8 {
  @if false {
    @content;
  }
}
@mixin govuk-not-ie8 {@content}

This change was introduced in pull request #3559: Remove IE8-related Sass and CSS build tasks.

Remove references to "Compatibility mode" and related features from your Sass

GOV.UK Frontend is no longer compatible with our old frameworks:

  • GOV.UK Elements
  • GOV.UK Template
  • GOV.UK Frontend Toolkit.

You cannot migrate an existing service to GOV.UK Frontend v5.0 if it is still using one of these frameworks -- you'll need to remain on the latest v4.x release until you've finished the migration. Remove any references to these Sass variables and mixins:

  • $govuk-compatibility-govukelements

  • $govuk-compatibility-govuktemplate

  • $govuk-compatibility-govukfrontendtoolkit

  • the govuk-compatibility mixin which could be used to conditionally output CSS when compatibility mode was enabled

  • remove compatibility-mode from the $govuk-suppressed-warnings list, if present

We've additionally removed features that were managed using the above variables. We've removed the following features and their corresponding variables:

  • access to the legacy colour palette using $govuk-use-legacy-palette
  • access to the legacy font using $govuk-use-legacy-font
  • use of legacy tabular fonts using $govuk-font-family-tabular
  • the ability to not use rem font sizes using $govuk-typography-use-rem

These changes were introduced in:

Remove references to font family variables from your Sass

Remove any references to following Sass variables:

  • $govuk-font-family-gds-transport
  • $govuk-font-family-nta
  • $govuk-font-family-nta-tabular

If you were using $govuk-font-family-gds-transport to set the font on an element, we recommend using the govuk-font mixin instead.

This change was introduced in pull request #3949: Simplify font family settings.

Remove references to govuk-button--disabled class from the HTML for the Button component

For the Button component, remove any references to the govuk-button--disabled class that we deprecated in GOV.UK Frontend v4.6.0.

Use the disabled attribute to mark <button> and <input> elements as being disabled instead.

We no longer support link buttons being disabled or using disabled styles.

This change was introduced in pull request #3557: Remove deprecated govuk-button--disabled class.

Remove references to the JavaScript for the Details component

The Details component no longer uses JavaScript, and is no longer polyfilled in older browsers.

If you are importing the JavaScript for this component individually, remove any references to it.

If you are not using our Nunjucks macros, remove the data-module="govuk-details" attribute from all <details> elements.

We've styled the details component so content does not look 'broken' in browsers that do not support it. If your service supports these browsers,  you will need to add your own polyfills.

This change was introduced in:

Update the GOV.UK logo

We've updated the GOV.UK logo to merge the GOV.UK text with the crown graphic. This is to make sure the full logo is always rendered correctly even if parts of the page, such as CSS or the Transport webfont, fail to load. We've also modified styles relating to the logo.

If you're using the govukHeader Nunjucks macro you don't need to change anything.

Otherwise, to update to the new logo:

  • remove <span class="govuk-header__logotype-text"> and its content
  • remove the <span class="govuk-header__logotype"> around the svg element
  • replace the svg element with this updated SVG, and make sure you also update the class name and attributes

This change was introduced in pull request #4449: Implement transitional crown in the Header component (v5.0).

Check your favicons, app icons and OpenGraph image still work

We've changed the names, formats and sizes of icon assets we distribute in Frontend. You will want to check that the correct files are copied in the right place and served at the right URLs.

The following files have been added to the assets folder:

  • manifest.json
  • images/favicon.svg
  • images/govuk-icon-180.png
  • images/govuk-icon-192.png
  • images/govuk-icon-512.png
  • images/govuk-icon-mask.svg

The following files have been removed from the assets folder:

  • images/govuk-apple-touch-icon.png
  • images/govuk-apple-touch-icon-152x152.png
  • images/govuk-apple-touch-icon-167x167.png
  • images/govuk-apple-touch-icon-180x180.png
  • images/govuk-mask-icon.svg

If you're not using the Nunjucks page template, you will need to replace the list of icons in the template's head with the following:

<link rel="icon" sizes="48x48" href="/assets/images/favicon.ico">
<link rel="icon" sizes="any" href="/assets/images/favicon.svg" type="image/svg+xml">
<link rel="mask-icon" href="/assets/images/govuk-icon-mask.svg" color="#0b0c0c">
<link rel="apple-touch-icon" href="/assets/images/govuk-icon-180.png">
<link rel="manifest" href="/assets/manifest.json">

You will need to update the file path to match your assets folder if it's not at the default location.

This change was introduced in pull request #4445: Implement transitional crown favicons (v5.0).

Remove the fallback GOV.UK crown logo from the  HTML for the Header component

The Header component previously included a fallback PNG version of the GOV.UK crown logo for Internet Explorer 8. As Frontend no longer supports Internet Explorer 8, we've removed this fallback.

If you're not using the Nunjucks macros, you'll need to remove this fallback from your HTML code. In your Header component:

  1. Remove the block of HTML containing the govuk-header__logotype-crown-fallback-image image, starting with <!--[if IE 8]> and ending with <![endif]-->.
  2. Remove <!--[if gt IE 8]><!--> and  <!--<![endif]--> from around the govuk-header__logotype-crown SVG, but don't remove the SVG.
  3. Delete the govuk-logotype-crown.png file from your assets folder.

You do not need to change any HTML if you're using the supplied Nunjucks macros, but you might still need to remove the govuk-logotype-crown.png image depending on how you are serving the font and image assets.

This change was introduced in pull request #3641: Remove fallback GOV.UK logo for IE8.

Remove references to govuk-header__navigation--no-service-name class from the HTML for the Header component

We've removed the govuk-header__navigation--no-service-name class which we deprecated in GOV.UK Frontend v4.3.0.

We no longer supply a dedicated class for headers with navigation but no service name. If you still need this feature, you can reproduce it in your own code using the govuk-spacing Sass mixin.

You could:

  • add a new app-header-navigation class to the header's <nav> tag (you can use the navigationClasses option for the Header component if you're using Nunjucks)
  • add the following styles for this class in your Sass:
.app-header-navigation {
    padding-top: govuk-spacing(7);
}

This change was introduced in pull request #3595: Remove deprecated govuk-header__navigation--no-service-name class.

Add the hidden attribute to the mobile menu button in the Header component

We've removed some styles from the govuk-header__menu-button class. These styles were included on the mobile menu button to avoid introducing a breaking change in GOV.UK Frontend v4.3.0.

If you're not using Nunjucks macros, and have not done so already, add the hidden attribute to the button's HTML to ensure it continues working as expected.

You do not need to make any changes if using the Nunjucks macro.

When working correctly, the button should only show on narrow screens when JavaScript is available. It should be hidden on wider screens or if JavaScript is unavailable.

This change was introduced in pull request #3596: Remove redundant display style from govuk-header__menu-button.

Update references to govuk-header__link--service-name class from the HTML for the Header component

We've removed the govuk-header__link--service-name class which we deprecated in GOV.UK Frontend v4.2.0.

Use the govuk-header__service-name class instead.

This change was introduced in pull request #3594: Remove deprecated govuk-header__link--service-name class.

Update references to govuk-!-margin-static and govuk-!-padding-static classes from the HTML

We've removed the override classes starting with govuk-!-margin-static and govuk-!-padding-static, which were deprecated in GOV.UK Frontend v4.3.1.

Use the classes starting with govuk-!-static-margin and govuk-!-static-padding instead.

This change was introduced in pull request #3593: Remove deprecated static spacing classes.

Update references to the govuk-warning-text__assistive class  from the HTML for the Warning Text component

For the Warning Text component, we've removed the govuk-warning-text__assistive class and its styles from GOV.UK Frontend. This class is unnecessary, as it duplicates the functionality of the govuk-visually-hidden class already present in Frontend.

If you're not using Nunjucks macros, update your warning text HTML to replace the govuk-warning-text__assistive class with the govuk-visually-hidden class.

This change was introduced in pull request #3569: Remove unnecessary class from Warning Text component.

Check your browser console for component initialisation errors

GOV.UK Frontend JavaScript components now provide errors if you initialise a component incorrectly.

These errors will be:

To make sure the components behave as intended, we encourage you to check your browser console and address any errors by updating your markup or configuration.

Errors you might see include:

  • SupportError - when GOV.UK Frontend is not supported in the current browser
  • ElementError - when component templates have missing or broken HTML elements
  • ConfigError - when component JavaScript configuration does not match our documentation

These changes were introduced in:

Check any JavaScript that uses HTMLElement.getAttribute to get the disabled state of a button works as expected

The disabled attribute on 'Disabled buttons' created using our Nunjucks macros no longer includes a value.

If you are using $button.getAttribute('disabled') to check for the disabled attribute in JavaScript, this will now return an empty string. This might cause unexpected behaviour if you are relying on the return value being the string 'disabled' or being truthy.

Instead, we recommend checking for the disabled attribute using $button.hasAttribute('disabled') or the $button.disabled IDL attribute.

This change was introduced in pull request #2830: Set the boolean disabled attribute consistently in the Button component.

Check that inverse buttons still look as expected if you have customised the brand colour

Inverse button components now use the $govuk-brand-colour setting to determine the button's text colour and the button's background tint when hovered or activated. The button will only look different if $govuk-brand-colour has been changed from the default.

You can restore the previous blue colour by setting $govuk-inverse-button-text-colour before importing the button component's Sass.

@import "node_modules/govuk-frontend/govuk/base";

$govuk-inverse-button-text-colour: govuk-colour("blue");

@import "node_modules/govuk-frontend/govuk/components/button/index";

This change was introduced in pull request #4043: Add ability to customise inverse button colours.

Check any Selects that have options without explicit values work as expected

The govukSelect macro will no longer include an empty value attribute for options that do not have a value set.

If that option is selected, the value of the Select will become the text content of the option, rather than an empty string.

If you need to maintain the existing behaviour, you can set the value to an empty string.

This change was introduced in pull request #3773: Omit the value attribute from select options with no value.

New features

Use the Task list component to give users an overview of the tasks they need to complete

The Task list component displays all the tasks a user needs to do, and allows users to easily identify which ones are done and which they still need to do.

Each task in the list can have a title, status, link and an optional hint. When a link is added, the whole row is clickable.

This change was introduced in pull request #2261: Task list component..

Use the new focus style for links containing non-text content

We've added a new focus style for use with non-text content, such as links containing images and focusable elements that are not form controls. This new style paints a visible yellow and black outline around the entire element, ensuring the focus style is visible in all situations.

For links containing images, we've added the govuk-link-image class. You should only use this class on links containing an image. If it also contains text, continue to use govuk-link instead.

<a class="govuk-link-image" href="#">
  <img src="..." alt="...">
</a>

You can use these styles in your own code by including the govuk-focused-box Sass mixin.

This change was introduced in pull request #3819: Add linked image focus style.

New link styles are now enabled by default

In GOV.UK Frontend v3.12.0 we introduced new link styles which are now enabled by default. They have:

  • underlines that are consistently thinner and a bit further away from the link text
  • a clearer hover state, where the underline gets thicker to make the link stand out to users

The new link styles are now enabled by default. If you are setting $govuk-new-link-styles to true in your Sass you can now remove this.

This change was introduced in:

Customise the colours of inverse buttons

For non-GOV.UK branded websites, you can now change the colours of inverse buttons - buttons intended for use on dark backgrounds.

To change the inverse button's background colour, set the $govuk-inverse-button-background-colour Sass variable.

To change the inverse button's text colour, set the $govuk-inverse-button-text-colour Sass variable.

@import "node_modules/govuk-frontend/govuk/base";

$govuk-inverse-button-background-colour: govuk-colour("yellow");
$govuk-inverse-button-text-colour: govuk-colour("black");

@import "node_modules/govuk-frontend/govuk/components/button/index";

This change was introduced in pull request #4043: Add ability to customise inverse button colours.

Precompiled CSS and JavaScript

The precompiled CSS and JavaScript files found in our GitHub releases are now also published to govuk-frontend on npm.

These changes were introduced in:

Check your tags align with design changes to the Tag component

We've changed the design of the Tag component to improve accessibility and readability.

Text within the tag is no longer bold and uppercase with extra letter spacing. It's now regular 19px text with the first letter of a word capitalised and the rest of the content lowercase. Due to this, there might be changes to the width of existing tags.

The colours have also changed to make them more distinguishable from buttons.

Check your service is using the correct capitalisation in the contents of tags and tags within phase banners.

This change was introduced in:

Recommended changes

We've recently made some non-breaking changes to GOV.UK Frontend. Implementing these changes will make your service work better.

Remove the X-UA-Compatible meta tag

Remove the meta tag from your page template.

Internet Explorer versions 8, 9 and 10 included a feature that would try to determine if the page was built for an older version of IE and would silently enable compatibility mode, which would modify the rendering engine's behaviour to match the older version of IE. Setting this meta tag prevented that behaviour.

Internet Explorer 11 deprecated this meta tag and defaulted to always using IE11's renderer when the page has a HTML5 doctype ().

As Frontend no longer supports Internet Explorer versions older than 11, you can now remove this meta tag.

This change was introduced in pull request #4434: Remove X-UA-Compatible meta tag.

Update the Pagination component's default aria-label

We've updated the default value of the Pagination component's aria-label to be more descriptive of the contents of the region. If you're using the component's default label, you might wish to update it to the new default of 'Pagination'.

You do not need to change anything if you're using the govukPagination Nunjucks macro.

This change was introduced in pull request #3899: Update default aria-label in Pagination component.

Update the Exit this Page button's default text

We've updated the default text of the Exit this Page button. It now includes visually-hidden text to clarify that the button is a safety tool and not a generic method of leaving the current page.

If you are using the component's default text, you might wish to update it to the new value: <span class="govuk-visually-hidden">Emergency</span> Exit this page

You do not need to change anything if you're using the govukExitThisPage Nunjucks macro.

This change was introduced in pull request #3989: Update default Exit This Page button text.

Add the rel attribute to the Exit this Page button and secondary link

Update the Exit this Page button and secondary link to include a new attribute and value: rel="nofollow noreferrer".

Adding this attribute does 2 things:

  • it instructs search engines that your service does not endorse the external website for the purposes of determining search engine rankings
  • it instructs web browsers to not send information about your service to the external website

This fixes a potential risk where the external website could detect that a user had visited from a GOV.UK page and play that information back to the user, which could risk a user's personal safety in some contexts.

You do not need to change the Exit this Page button if you're using the govukExitThisPage Nunjucks macro. You will still have to update the secondary link manually.

This change was introduced in pull request #4054: Add rel attribute to the Exit this Page button. Thanks to Greg Tyler for reporting this issue.

Update titles of the action links inside the Summary Card

If you're not using our Nunjucks macro, we recommend you update the action links :

  • of the Summary Card (inside the element with the govuk-summary-card__actions class)
  • of the Summary List it contains (inside the element with the govuk-summary-list__actions class)

You'll need to either:

  • append a visually hidden <span> with the title of the card, if there's none already
  • or append the title of card to the existing visually hidden span, if there was one already

The final link should be structured as such:

<a class="govuk-link <EXISTING_CLASSES>" <EXISTING_ATTRIBUTES>>
  <EXISTING_VISIBLE_TITLE>
  <span class="govuk-visually-hidden">
    <EXISTING_HIDDEN_TEXT_IF_PRESENT>
    <SUMMARY_CARD_TITLE>
  </span>
</a>

This is to make sure each link has a unique accessible name, which will help users of assistive technology distinguish them from one another.

This change was introduced in pull request #3961: Append card title to action links inside of a Summary Card.

Fixes

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

4.7.0 (Feature release)

Note: This release was created from the support/4.x branch.

New features

Added the Exit This Page component to help users quickly exit a page or service

You can now choose to use the exit this page component to help users quickly leave a page or service which contains sensitive information.

This was added in pull request #2545: Add exit this page component.

Added inverse modifier for buttons on dark backgrounds

You can now choose to use the govuk-button--inverse class to style buttons on dark backgrounds with a white background colour.

This change was made in pull request #3556: Add inverse button styles.

Added inverse modifier for breadcrumbs on dark backgrounds

You can now choose to use the govuk-breadcrumbs--inverse class to style breadcrumbs on dark backgrounds with white text, links and arrows.

This change was made in pull request #3774: Add inverse breadcrumb and back link modifiers and styles.

Added inverse modifier for back links on dark backgrounds

You can now choose to use the govuk-back-link--inverse class to style back links on dark backgrounds with white links and arrows.

This change was made in pull request #3774: Add inverse breadcrumb and back link modifiers and styles.

Fixes

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

4.6.0 (Feature release)

New features

Updated the appearance of disabled form controls

We’ve updated the disabled state of Text Input, Textarea, Select and File Upload components so it is consistent across browsers and devices. They’re also now consistent with the existing disabled styles for Buttons, Checkboxes, and Radios.

Disabled form controls appear at 50% opacity and with an alternative cursor appearance when hovered over.

This was added in pull request #3187: Add disabled styles for form controls.

Added a top-level disabled parameter to form controls

We’ve updated the Nunjucks macros for Text Input, Textarea, Select and File Upload components to include a top-level disabled parameter. This will make it easier to enable the disabled state for these controls.

{{ govukInput({
  id: "disabled-input",
  name: "disabled-input",
  value: "Unchangeable value",
  disabled: true
}) }}

Disabled form controls have poor contrast and can confuse some users, so avoid them if possible.

Only use disabled form controls if research shows it makes the user interface easier to understand.

This was added in pull request #3187: Add disabled styles for form controls.

Configure whether the Accordion remembers and restores sessions

By default, when a user leaves a page, the Accordion will remember the layout of expanded and collapsed sections selected by the user. If the user returns to the page, this layout will be restored and override any sections manually set as expanded in code.

You can now disable this functionality by using the rememberExpanded option in the govukAccordion Nunjucks macro.

If you're not using the Nunjucks macro, you can disable it using the data-remember-expanded HTML attribute.

This was added in pull request #3342: Add option to disable sessionState in Accordion.

Added id parameter to Buttons

We’ve updated the Button Nunjucks macro to include an optional id parameter.

{{ govukButton({
  text: "Save and continue",
  id: "continue-button"
}) }}

This was added in pull request #3344: Adding optional ‘id’ attribute to button component.

Thanks to Tom Billington for this contribution.

Added a modifier for text input styles that accept sequences of digits

We've added a new .govuk-input--extra-letter-spacing class for Text Input. This increases readability of text inputs that receive sequences of digits (like security codes, references or phone numbers).

You can add it through the classes option when using Nunjucks, or directly in the class attribute of the <input> when using HTML.

This was added in pull request #2230: Add extra letter spacing modifier for inputs

Deprecated features

Stop using JavaScript API properties other than the init method

We have deprecated all of the JavaScript properties in the API, except for the init method for each component. We'll make all of the deprecated JavaScript properties private in our next main release.

Please let us know if you're using parts of the API other than the init method by filling in this form. We'll use this information when prioritising future additions to the public API.

This was added in pull request #3499: Deprecate all JavaScript instance properties the except init method.

Stop using the .govuk-button--disabled class on buttons

We have deprecated the .govuk-button--disabled class and will remove it in the next major release.

If a Button uses a <button> or <input> element, use the disabled HTML attribute instead.

You will not need to make any changes if you're using the govukButton Nunjucks macro.

Disabling links that are styled to look like buttons will not be supported by future releases.

This was added in pull request #3326: Deprecate govuk-button--disabled class.

Stop using the deprecated Internet Explorer 8 mixins and settings

The next main release of GOV.UK Frontend will remove support for Internet Explorer 8 (IE8). In preparation for this, we've deprecated the settings and mixins used when generating IE8 specific stylesheets.

You'll start seeing deprecation warnings if you're:

If you no longer need to support IE8, we recommend you stop generating an IE8 specific stylesheet and remove references to the IE8 mixins from your code.

You can also silence these deprecation warnings by adding ie8 to the $govuk-suppressed-warnings setting, but once we’ve released v5.0 you will need to address them as part of the upgrade process.

Fixes

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

4.5.0 (Feature release)

New features

Use summary cards to visually separate multiple summary lists on a single page

You can now use the summary card. This new variant of the Summary list component can help you:

  • design and build pages with multiple summary lists
  • show visual dividers between summary lists
  • allow users to apply actions to entire lists

This was added in pull request #2931: Add summary card enhancement to summary list.

Search within accordion content on supporting browsers

We've updated the Accordion component to use the new hidden="until-found" attribute value.

This allows the browser's native 'find in page' functionality to search within and automatically open sections of the accordion. Currently, this functionality is only supported by recent versions of Google Chrome, Microsoft Edge and Samsung Internet.

This was added in pull requests:

Source maps for precompiled files

You can now use source maps to help identify errors and console messages from GOV.UK Frontend precompiled files.

This was added in pull request #3023: Add source maps to compiled JavaScript and CSS.

Fixes

We've fixed errors in IE8 caused by updates to our precompiled JavaScript. The issue prevented some polyfills from running, but was limited to the release-v4.4.1.zip and release-v4.4.0.zip assets on GitHub releases:

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

4.4.1 (Fix release)

Note: This release was created from the support/4.4.x branch.

Fixes

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

4.4.0 (Feature release)

New features

Change the Button component's background and text colour

For non-GOV.UK branded websites, you can now change the Button component background and text colour.

To change the Button component background colour, set the $govuk-button-background-colour Sass variable.

To change the Button component text colour, set the $govuk-button-text-colour Sass variable.

@import "node_modules/govuk-frontend/govuk/base";

$govuk-button-background-colour: govuk-colour("yellow");
$govuk-button-text-colour: govuk-colour("black");
@import "node_modules/govuk-frontend/govuk/components/button/index";

This was added in pull request #2752: Change the Button component background and text colour. Thanks to Nick Colley for this contribution.

Localise the navigation menu toggle button

When using the header Nunjucks macro, you can now translate the text of the mobile navigation menu toggle button by using the menuButtonText parameter.

You should avoid lengthy values for the menuButtonText parameter. If the text is too long it can overflow and cause visual issues.

This was added in pull request #2720: Add parameter to localise mobile menu toggle button.

Localise the character count's textarea description/fallback text

When using the character count Nunjucks macro, you can now translate the description of textarea by using the textareaDescriptionText option.

This text is announced by screen readers when the character count input is focused. It's also displayed visually as a fallback if JavaScript is not available.

This was added in pull request #2742: Add ability to customise character count fallback text, and the option renamed to textareaDescriptionText in pull request #2915.

Localise the character count's counter message

You can now translate the text shown by the character count component to inform users of:

  • when they have reached the maximum number of characters or words
  • the number of characters or words over or under the allowed maximum

The Nunjucks macro accepts new options so you can customise each message. You can:

  • Use charactersAtLimitText or wordsAtLimitText to provide the text that shows when users have reached the limit.
  • Use charactersUnderLimitText or wordsUnderLimitText to provide the text that shows when users are under the limit. The component will pluralise the message according to the configured locale and the number of characters or words remaining.
  • Use charactersOverLimitText or wordsOverLimitText to provide the text that shows when users are over the limit. The component will pluralise the message according to the configured locale and the number of characters or words remaining.

You'll find guidance about the plural forms in our documentation about localising GOV.UK Frontend. The component will replace %{count} with the number of characters over or under the limit.

If you're not using Nunjucks macros, you can use data-* attributes to provide these translations. Within the attribute value, any quotation marks or other characters reserved by HTML needs to be converted into their HTML entity equivalents.

You can:

  • use data-i18n.characters-at-limit or data-i18n.words-at-limit for when users are at the limit
  • configure the text that informs the end user they are under the character or word limit, by using data-i18n.characters-under-limit.{other,many,few,two,one,zero} or data-i18n.words-under-limit.{other,many,few,two,one,zero}, with one suffix for each plural form required by your locale
  • configure the text that informs the end user they are over the character or word limit, by using data-i18n.characters-over-limit.{other,many,few,two,one,zero} or data-i18n.words-over-limit.{other,many,few,two,one,zero}, with one suffix for each plural form required by your locale

You can also provide these messages using a JavaScript configuration object when creating an instance of the component or initialising all components. See our guidance on localising GOV.UK Frontend for how to do this.

This was added in the following pull requests:

Localise the character count's input description for assistive technologies

When configuring the character count's limit in JavaScript, you can customise the description provided to assistive technologies when users focus the input (so it indicates the overall limit of characters or words).

Depending on the plural form required by your locale, you can pass the description in the HTML using the data-i18n.textarea-description.{other,many,few,two,one,zero} attribute on the element to provide the text to set as the description.

You can also provide these messages using a JavaScript configuration object when creating an instance of the component or initialising all components. See our guidance on localising GOV.UK Frontend for how to do this.

This was added in pull request #2915.

Localise the accordion's toggle buttons

You can now translate the text of the accordion component's show and hide toggle buttons.

When using the Nunjucks macro, you can use the new showSectionText and hideSectionText parameters to customise the text of the 'show' and 'hide' toggles in each section.

You can also use showAllSectionsText and hideAllSectionsText parameters to customise the text of the toggle at the top of the accordion.

If you're not using the Nunjucks macro, you can customise these using data-* attributes. Within the attribute value, any quotation marks or other characters reserved by HTML needs to be converted into their HTML entity equivalents.

  • data-i18n.show-section
  • data-i18n.show-section-aria-label
  • data-i18n.hide-section
  • data-i18n.hide-section-aria-label
  • data-i18n.show-all-sections
  • data-i18n.hide-all-sections

You can also change this text for all instances of the Accordion using a JavaScript configuration object. See our guidance on localising GOV.UK Frontend for how to do this.

This was added in pull requests:

Suppress deprecation warnings

You can now suppress warnings from deprecations within GOV.UK Frontend by updating the $govuk-suppressed-warnings map in Sass. Every deprecation warning will now include a warning "key" which you can use in the following code, placed at the root of your sass project:

$govuk-suppressed-warnings: (
  deprecated-feature
);

This was added in #2911 Add warning suppression functionality

Configure components in JavaScript

JavaScript components can get the same configuration options in 2 ways - through data attributes, as before, and now when creating an instance. These components are:

  • the Button component, for its preventDoubleClick option (matching data-prevent-double-click)
  • the CharacterCount component, for its maxlength, maxwords and threshold options (matching data-maxlength, data-maxwords and data-threshold, respectively)
  • the ErrorSummary component, for its disableAutoFocus option (matching data-disable-auto-focus)
  • the NotificationBanner component, for its disableAutoFocus option (matching data-disable-auto-focus)

You can leave out these configuration options when using the Nunjucks macro and provide configuration when:

  • creating a component, in a configuration object as second argument
  • initialising components in bulk using initAll

For example:

// Creating a single instance
var button = document.querySelector('[data-module="button"]')
new GOVUKFrontend.Button(button, {preventDoubleClick: true})

// Or initialising components in bulk
GOVUKFrontend.initAll({
  button: {
    preventDoubleClick: true
  }
  // Or, for the other components,
  // characterCount: {/* options */},
  // errorSummary: {/* options */},
  // notificationBanner: {/* options */}
})

You can find more information about component configuration in GOV.UK Frontend documentation.

This was added in pull requests specific for each components:

Recommended changes

Update the HTML for the error summary

If you're not using the Nunjucks macros, you can improve the experience for screen reader users by making these changes to the error summary markup:

  • Remove aria-labelledby="error-summary-title" and role="alert" from the parent element (govuk-error-summary)
  • Add a div wrapper around the contents of govuk-error-summary with the attribute role="alert"
  • Remove id="error-summary-title" from the error summary h2 (govuk-error-summary__title)

This will enable screen reader users to have a better, more coherent experience with the error summary. It will make sure users of JAWS 2022 or later will hear the entire contents of the error summary on page load and therefore have further context on why there is an error on the page they're on.

This was added in pull request #2677: Amend error summary markup to fix page load focus bug in JAWS 2022.

Deprecated features

Stop using the compatibility mode settings

In GOV.UK Frontend v5.0 we will stop supporting compatibility with legacy codebases. We are therefore deprecating the compatibility mode variables associated with legacy codebases:

  • $govuk-compatibility-govukfrontendtoolkit
  • $govuk-compatibility-govuktemplate
  • $govuk-compatibility-govukelements

This was introduced in pull request #2882: Deprecate compatibility mode settings.

Stop using settings associated with legacy codebases

In GOV.UK Frontend v5.0 we will stop supporting compatibility with legacy codebases. As part of this, we're deprecating settings controlled by compatibility mode variables. This includes the govuk-compatibility mixin and the following settings:

  • $govuk-use-legacy-palette
  • $govuk-use-legacy-font
  • $govuk-typography-use-rem
  • $govuk-font-family-tabular

This was introduced in pull request #2844: Remove compatibility mode from govuk-frontend.

Fixes

In pull request 2851: Support Prototype Kit v13 we've introduced support for the plugins system included in the upcoming Prototype Kit v13.

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

4.3.1 (Patch release)

Recommended changes

Replace deprecated govuk-!-margin-static and govuk-!-padding-static classes

We've fixed an error in the naming convention of the static spacing override classes we'd introduced in v4.3.0. These classes should start with govuk-!-static, and we've now deprecated the incorrect classes.

If you're using the static spacing margin override classes, replace any classes starting with govuk-!-margin-static with govuk-!-static-margin. For example: govuk-!-margin-static-2 would become govuk-!-static-margin-2.

If you're using the static spacing padding override classes, replace any classes starting with govuk-!-padding-static with govuk-!-static-padding. For example: govuk-!-padding-static-2 would become govuk-!-static-padding-2.

We've deprecated the govuk-!-margin-static and govuk-!-padding-static classes, and will remove them in a future major release.

This change was introduced in pull request #2770: Fix ordering of properties in static spacing override classes. Thanks to @garrystewart for reporting this issue.

Fixes

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

4.3.0 (Feature release)

New features

Customise the Open Graph image URL without duplicate meta tags

You can now customise the Open Graph image URL included in the head by setting the opengraphImageUrl Nunjucks option.

Also, the default Open Graph image URL meta tag will now only be included if you set the either opengraphImageUrl or assetUrl.

This was added in pull request #2673: Allow Open Graph image URL to be customised.

Localise the content licence and copyright statements

When using the footer Nunjucks macro, you can now translate the text of the Open Government Licence (OGL) and Crown copyright statements using the contentLicence and copyright parameters.

Visit The National Archives' documentation on OGL and Crown copyright for information on what you need to include in these statements.

This was added in pull request #2702: Allow localisation of content licence and copyright notices in Footer.

Pass HTML directly into compatible components

If using the Nunjucks macros, you can now pass HTML content directly into compatible components using the Nunjucks call syntax. If HTML is provided through the call syntax, the nunjucks macro will ignore the HTML and text options.

Components updated to support this syntax are:

  • Details
  • Error summary (mapped to descriptionHtml parameter)
  • Inset text
  • Notification banner
  • Panel

This was added in pull request #2734: Update various components to be callable.

Use new override classes to apply static spacing

You can now use static spacing override classes to apply spacing from the static spacing scale to elements of your design.

The new classes start with: govuk-!-static- followed by either margin- or padding-, and then a spacing unit number.

To apply spacing in a single direction, include left-, right-, top-, or bottom- just before the spacing unit.

For example:

  • govuk-!-static-margin-9 will apply a 60px margin to all sides of the element at all screen sizes
  • govuk-!-static-padding-right-5 will apply 25px of padding to the right side of the element at all screen sizes
  • govuk-!-static-margin-0 will remove all margins at all screen sizes

This was added in pull request #2672: Add static spacing override classes. Thanks to @patrickpatrickpatrick for this contribution.

Deprecated features

Remove deprecated govuk-header__navigation--no-service-name class in the header

We've deprecated the govuk-header__navigation--no-service-name class, and will remove it in a future major release.

This was added in pull request #2694: Deprecate .govuk-header__navigation--no-service-name.

Recommended changes

We've recently made some non-breaking changes to GOV.UK Frontend. Implementing these changes will make your service work better.

Add hidden to the mobile menu button in the header component

If you're not using the Nunjucks macros, add the hidden attribute to the mobile menu button in the header component. The mobile menu button is govuk-header__menu-button.

We've changed the header's mobile menu functionality to use the hidden attribute instead of using CSS to show/hide the mobile menu. Adding hidden to the mobile menu button by default will make sure that it does not display for users when javascript does not load.

This was added in pull request 2727: Make use of hidden in header navigation functionality. Thanks to @NickColley and @kr8n3r for their contributions.

Fixes

In pull request 2678: Replace ex units with ems for input lengths, we changed how we define input lengths in our CSS. Browsers might now display these inputs as being slightly wider than before. The difference is usually fewer than 3 pixels.

We’ve also made fixes in the following pull requests:

4.2.0 (Feature release)

New features

Help users navigate through pages with pagination

You can now use pagination to help users navigate forwards and backwards through a series of pages. For example, in search results or guidance that's divided into multiple website pages.

This was added in pull request #2610: Add pagination component.

Check checkboxes by using the values Nunjucks option

When using the govukCheckboxes Nunjucks macro, you can now use the values option to determine which checkboxes should already be checked when the page loads.

For example, values: ['red', 'blue'] would check any checkboxes that have a value of 'red' or 'blue'.

You can use this option instead of setting the boolean checked option on each individual checkbox.

This change was introduced in pull request #2616: Allow selecting options by passing current values.

Check a radio button by using the value Nunjucks option

When using the govukRadios Nunjucks macro, you can now use the value option to determine which radio should already be checked when the page loads.

For example, value: 'red' would check the radio that has a value of 'red'.

You can use this option instead of setting the boolean checked option on each individual radio.

This change was introduced in pull request #2616: Allow selecting options by passing current values.

Select an option in a select by using the value Nunjucks option

When using the govukSelect Nunjucks macro, you can now use the value option to determine which option should already be selected when the page loads.

For example, value: 'red' would select the option that has a value of 'red'.

You can use this option instead of setting the boolean selected option on each individual option.

This change was introduced in pull request #2616: Allow selecting options by passing current values.

Recommended changes

Replace deprecated govuk-header__link--service-name class in the header

If you're not using the Nunjucks macros in the header, replace any instances of the class govuk-header__link--service-name with govuk-header__service-name.

We've deprecated the govuk-header__link--service-name class, and will remove it in a future major release.

This change was introduced in pull request #2617: Do not make the service name in the header a link if no serviceUrl is provided.

File extensions added for JavaScript ES Module imports

We have updated our component ES module JavaScript to include missing file extensions not provided in release 4.1.0. If you have received an error similar to the following, for example when running or building your application, this fix should resolve the issue.

Cannot find module '../node_modules/govuk-frontend/govuk-esm/common' imported from ../node_modules/govuk-frontend/govuk-esm/all.mjs

You should not need to make any changes if you are successfully importing our JavaScript as ES modules with version 4.1.0, but there still might be config you can remove. For example, removing fullySpecified: false from your Webpack config file.

This change was introduced in pull request #2658: Add missing mandatory file extensions for ESM JavaScript. Thanks to @colinrotherham and @tvararu for reporting issues and suggesting and testing fixes.

Fixes

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

4.1.0 (Feature release)

New features

Import GOV.UK Frontend JavaScript as ECMAScript (ES) modules

You can now import our component JavaScript into your service as ES modules, if you're using a bundler.

This change allows you to import only the JavaScript you need, and helps reduce duplication of polyfills.

Because we're shipping ES modules in addition to how we currently publish our component JavaScript, this change is backwards compatible. You will not be required to make any changes unless you want to.

If you want to import using ES modules, we recommend you only use import to import the JavaScript for components you're using in your service. For example:

import { SkipLink, Radios } from 'govuk-frontend'

var $skipLink = document.querySelector('[data-module="govuk-skip-link"]')
if ($skipLink) {
  new SkipLink($skipLink).init()
}

var $radios = document.querySelectorAll('[data-module="govuk-radios]')
if ($radios) {
  for (var i = 0; i < $radios.length; i++) {
    new Radios($radios[i]).init()
  }
}

If you need to import all of GOV.UK Frontend's components, then use the initAll function to initialise them:

import { initAll } from 'govuk-frontend'
initAll()

Depending on the bundler you use, you may also need to make changes to your JavaScript bundler configuration file. You can read more in our installation instructions about importing JavaScript using a bundler.

This was added in pull request #2586: Publish our JavaScript as ES modules alongside Universal Module Definition (UMD).

Recommended changes

We've recently made some non-breaking changes to GOV.UK Frontend. Implementing these changes will make your service work better.

Remove aria-live from the character count component

If you're not using the Nunjucks macros, remove the aria-live attribute from the character count message element. This element's content no longer updates, as we've moved the live counter functionality to a new element injected by JavaScript.

This change was introduced in pull request #2577: Refactor character count to inject new element.

Remove pattern from the date input component

If you're not using the Nunjucks macros, remove pattern="[0-9]*" from each of the date input's elements.

We originally added the pattern attribute to make numeric keypad functionality the default functionality in Safari on iOS. However, we no longer need to use it, as the inputmode attribute provides this functionality for newer Safari versions.

This change was introduced in pull request #2599: Remove pattern attribute from date input component.

Fixes

We've made the following fixes in pull request #2577: Refactor character count to inject new element:

  • fix character count message being repeated twice by screen readers
  • fix character count hint text being announced as part of the count message
  • fix multiple outdated character count messages being announced at once
  • fix character count message being announced when input length is below a defined threshold

We’ve also made fixes in the following pull requests:

4.0.1 (Fix release)

Recommended changes

We've recently made some non-breaking changes to GOV.UK Frontend. Implementing these changes will make your service work better.

Remove the tabindex attribute from the error summary component

If you're not using Nunjucks macros, remove the tabindex attribute from the error summary's HTML. The component JavaScript now adds and removes this attribute.

This change was introduced in pull request #2491: Prevent error summary from being refocused after it has been initially focused on page load.

Fixes

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

4.0.0 (Breaking release)

Breaking changes

This release contains a lot of breaking changes, but we expect many of them will only affect a small number of users. However, to make sure your service still works after you upgrade, you should read the release notes and make any required changes.

Check your accordions still display as expected

We've changed the design of the accordion. You can see its new look and read the revised guidance, particularly about when and when not to use accordions.

You should check your accordions still display as expected if you have any:

  • accordions with custom styles
  • section headings that contain unusual formatting (for example, wrappers)

You do not need to make changes to the content that accordions hide or show, as this release's changes do not affect it.

These changes were introduced in pull request #2257: Update accordion design. Thanks to Mia Allers, Owen Jones, Nikin Nagewadia and Chris Yoong for their contributions.

Only use the accordion’s summary line for ‘phrasing content’

The summary line is now inside the HTML button element, so you can only add 'phrasing content' to it. Do not use any non-phrasing content, as the resulting HTML will not be valid.

This change was introduced in pull request #2257: Update accordion design.

Review and revise the accordion's summary line content

Only add a summary line if you need to, as it's likely to make the button text too long.

If you're already using the summary line, review your use of the summary line to make sure you actually need it.

If you need to keep the summary line, review the accordion guidance and make the summary line as short as possible.

Update the HTML for summary lists

We've updated the HTML for the summary list component to avoid nesting <span> elements within <dd> elements, which is invalid HTML. This update only affects you if you have summary lists that include a mix of rows with and without actions. You can read more about adding actions to rows.

If you're not using Nunjucks macros, do not include an empty <span class="govuk-summary-list__actions"></span> in rows without actions. Instead, add the govuk-summary-list__row--no-actions modifier class to the row.

This change was introduced in pull request #2323: Avoid invalid nesting of <span> within a <dd> in summary list. Thanks to Malcolm Hire for reporting this issue.

Update the HTML for navigation in the header

We've updated the HTML for the header. This update only affects you if your header includes navigation.

Any additional classes passed using the navigationClasses Nunjucks option are now applied to the <nav> rather than the <ul>. Check the additional classes are still doing what you expect.

If you're not using Nunjucks macros, then you should:

  • move the <button> inside the <nav>, immediately before the <ul>
  • move the aria-label attribute from the <ul> to the <nav>
  • move the govuk-header__navigation class from the <ul> to the <nav>
  • add the govuk-header__navigation-list class to the <ul>

Check your changes against the header example in the Design System to make sure you have correctly implemented them.

This change was introduced in pull request #2427: Improve the screen reader experience for the header menu.

Style any custom HTML in your cookie banner

We've removed the default font styles from the cookie banner Sass. This change makes it more obvious when you have not added classes and styles to any custom HTML.

If you're passing custom HTML into the cookie banner component (for example, using the html Nunjucks parameter), you must make sure you're applying the appropriate classes and styles to that HTML. This could look like, for example, adding the govuk-body class to any paragraph tags. You must do this to prevent your cookie banner displaying with unstyled text.

This change was introduced in pull request #2432: Remove default font styles from cookie banner Sass.

Update the HTML for hints

In GOV.UK Frontend v3.8.0, we updated the HTML for hints to use a <div> rather than a <span> element, to allow the use of block elements. We've now removed the styles which made the hint <span> display as block.

If you’re not using Nunjucks macros, update your hint HTML to use a <div> rather than a <span>. For example: <div id="input-hint" class="govuk-hint"></div> instead of <span id="input-hint" class="govuk-hint"></span>.

This change was introduced in pull request #2437: Remove display:block on hint component.

Include JavaScript for skip link to improve screen reader announcements

We've added JavaScript for the skip link component to set focus to the linked element, for example, the main content on the page. This helps screen readers read the linked content when users use the skip link component.

If you're importing JavaScript for individual components, import the skip link JavaScript.

If you're not using Nunjucks macros, add a data-module="govuk-skip-link" attribute to the component HTML. For example:

<div class="govuk-skip-link" data-module="govuk-skip-link">
...
</div>

Once you've made the changes, check the skip link JavaScript works. To do this, select the skip link and check the linked element (usually the <main> element) in the browser has a tabindex attribute.

This change was introduced in pull request #2450: Set focus to skip link target to improve screen reader announcements.

Update the HTML for error messages

We’ve updated the HTML for the error message component to use a <p> element instead of a <span> element, as this is more semantically correct.

If you’re not using Nunjucks macros, swap the <span class="govuk-error-message"> for a <p class="govuk-error-message">.

This change was introduced in pull request #2452: Update error messages to use paragraph tags instead of spans.

Check components that conditionally reveal content still work

On radios and checkboxes, the JavaScript now looks within the whole page for conditionally-revealed content. Before, it only looked within the same set of radios or checkboxes.

If you see unexpected behaviour, make sure the revealed content's id is unique within the page the content is on. Reusing the same id within a page could cause a radio or checkbox to reveal or hide the wrong element, and also means your HTML is invalid.

This change was introduced in pull request #2370: Prevent issues with conditionally revealed content when content id includes CSS syntax characters.

Check the character count component still works as expected

On character counts, the JavaScript now looks within the whole page for the count message, which will be something similar to “You have 200 characters remaining”. Before, it only looked within the character count component.

If you see unexpected behaviour, make sure the id for the textarea component is unique within the page the content is on. Reusing the same id within a page could cause the wrong count message to update, and also means your HTML is invalid.

This change was introduced in pull request #2408: Prevent issues with character count when textarea id includes CSS syntax characters.

Check individually-imported JavaScript modules work as expected

You do not need to do anything if you have done at least one of the following:

  • followed our Getting Started guide and are importing all of the GOV.UK Frontend JavaScript in one go via all.js
  • installed GOV.UK Frontend using precompiled files

We've changed the naming of our components' JavaScript modules so individual imports are now attached to window.GOVUKFrontend.[ComponentName] instead of window.GOVUKFrontend.

You can now import multiple modules without overwriting the previous one, for example:

//= require govuk/components/accordion/accordion.js
//= require govuk/components/button/button.js

# These modules are available under window.GOVUKFrontend.Accordion and window.GOVUKFrontend.Button respectively

If you're importing JavaScript modules individually, you should check any references to window.GOVUKFrontend in your code and update them to point to the correct component, window.GOVUKFrontend.[ComponentName]. You can now remove any workarounds you may have implemented.

This change was introduced in pull request #2426: Rename exported JavaScript modules to include component name. Thanks to Alex Jurubita for reporting this issue.

Import 'base' before importing Sass files from core or overrides layers

If you import individual files from the core or overrides layers, you might see the error Undefined mixin 'govuk-exports' or no mixin named govuk-exports when compiling your Sass.

To fix the error, import node_modules/govuk-frontend/govuk/base first. For example:

@import "node_modules/govuk-frontend/govuk/base";
@import "node_modules/govuk-frontend/core/typography";

This change was introduced in pull request #2455: Remove 'base' import from files in core and overrides layers.

Import 'template' Sass file from the objects layer instead of the core layer

If you import the 'template' Sass file from the core layer, you might see the error File to import not found or unreadable: template when compiling your Sass.

To fix this error, replace any imports of node_modules/govuk-frontend/govuk/core/template with node_modules/govuk-frontend/govuk/objects/template.

This change was introduced in pull request #2463: Move template styles from core to objects layer.

Check your footer displays as expected

We’ve made some fixes to the alignment of columns within the footer component, so they now align with our grid. We've also removed the logic that assumes a 2-section layout displays as a 'two-thirds and one-third' layout. Footer sections now display as full-width by default.

If you're using the Nunjucks macros, check your footer displays as expected and use the width macro option to set the width you want for each section.

If you're not using the Nunjucks macros, check your footer displays as expected and use the standard Design System grid classes on the govuk-footer__section element to set the width. For example:

<div class="govuk-footer__section govuk-grid-column-two-thirds">...</div>

This change was introduced in pull request #2462: Fix footer alignment with grid classes and add width macro option.

Remove deprecated $govuk-border-width-form-element-error variable

In GOV.UK Frontend v3.8.0, we made the border width of form elements in their error state the same as for form elements in their normal state and deprecated the $govuk-border-width-form-element-error variable.

Before, an element's border got thicker to show the element was in an error state. However, elements in their focused state also have a thicker border. As a result, when users focused an element in an error state, the only visible border-change was from red to black. Not all users could perceive this change. So, we reduced the element border's width, to make sure its thickness changes when users focus.

We've now removed $govuk-border-width-form-element-error completely.

If you’re referencing $govuk-border-width-form-element-error in your own Sass, you must remove it. If you're also defining your own error state, you only need to change the border colour.

You should avoid overriding the border width. For example, replace border: $govuk-border-width-form-element-error solid $govuk-error-colour; with border-color: $govuk-error-colour;.

You should also remove any override of $govuk-border-width-form-element-error from your Sass. This override no longer does anything.

This change was introduced in pull request #1963: Remove deprecated $govuk-border-width-form-element-error variable.

Remove deprecated govuk-main-wrapper and govuk-main-wrapper--l mixins

We've removed the govuk-main-wrapper and govuk-main-wrapper--l mixins we deprecated in GOV.UK Frontend v3.0.0.

Remove any use of these mixins in your own Sass. You can replace these mixins with direct references to the spacing mixins.

This change was introduced in pull request #2385: Remove deprecated govuk-main-wrapper and govuk-main-wrapper--l mixins.

Remove calls to deprecated iff Sass function

We've removed the iff function we deprecated in GOV.UK Frontend version 3.6.0.

If you’re calling iff from your own Sass, you should use Sass's native if function instead.

This change was introduced in pull request #2409: Remove deprecated iff Sass function.

Remove deprecated govuk-tag--inactive class

We've removed the govuk-tag--inactive class we deprecated in GOV.UK Frontend v3.6.0.

Replace any use of this class with the govuk-tag--grey class.

This change was introduced in pull request #2417: Remove deprecated govuk-tag--inactive class.

Recommended changes

We've recently made some other changes to GOV.UK Frontend. While these are not breaking changes, implementing them will make your service work better.

You do not need to do anything if you're using Nunjucks macros.

Change date input from type="number" to inputmode="numeric"

There are some known issues with inputs of type="number". Read our research into the issues with type="number".

If you’re not using Nunjucks macros, remove the type="number" attribute from the date input component.

Replace it with type="text" and inputmode="numeric". For example:

<input class="govuk-input govuk-date-input__input" id="passport-issued-month" name="passport-issued-month" type="text" pattern="[0-9]*" inputmode="numeric">

This change was introduced in pull request #1704: Update date input to use type=text and inputmode=numeric.

Fix fallback logo so Chrome will not flag it to screen readers

If you’re not using Nunjucks macros, change the SVG markup within the header, footer and button components. We’ve added this fix so screen readers will not announce the fallback image to users.

For the header, footer and button, replace role="presentation" with aria-hidden="true". For example:

<svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true" focusable="false">

This change was introduced in pull request #1724: Fix fallback logo so Chrome will not flag it to screen readers.

Add data-nosnippet attribute to cookie banner

Apply a data-nosnippet attribute to the cookie banner component to stop it appearing in Google Search snippets.

If you’re not using Nunjucks macros, add a new data-nosnippet attribute to the cookie banner.

<div class="govuk-cookie-banner " data-nosnippet role="region" aria-label="Cookies on your service">

This change was introduced in pull request #2192: Add data-nosnippet to prevent cookie banner text appearing in Google Search snippets.

Fixes

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

3.14.0 (Feature release)

Note: This release was created from the support/3.x branch.

New features

Set text alignment with override classes

You can now use the govuk-!-text-align-left, govuk-!-text-align-centre and govuk-!-text-align-right CSS classes to set text alignment on elements.

This was added in pull request #2339: Add text-align override classes. Thanks to Ed Horsford for reporting this issue.

Define negative spacing using the govuk-spacing function

You can now pass the negative equivalent of a point from the spacing scale to the govuk-spacing function to get negative spacing.

For example, govuk-spacing(1) returns 5px, and govuk-spacing(-1) returns -5px.

This was added in pull request #2348: Allow govuk-spacing to output negative spacing. Thanks to Chris Hill-Scott for reporting this issue.

Fixes

3.13.1 (Fix release)

Fixes

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

3.13.0 (Feature release)

New features

Add a 'none' option and 'or' divider to checkboxes

You can now add a 'none' option to checkboxes. For example, 'None of the above' or 'None of these options apply to me'.

Use the 'none' option to allow users to state that none of the checkboxes apply to them. Otherwise, users would have to work out that they should leave all the checkboxes unticked.

You can now also add an 'or' divider before the 'none' option. Use the 'or' divider to make the 'none' option more visible to users.

This was added in pull request #2151: Add 'None of the above' and 'or' divider to checkboxes. Thanks to @frankieroberto for contributing this improvement.

Add a nonce attribute to inline scripts

If your service has a Content Security Policy (CSP), you can now add a nonce attribute to inline scripts within the Nunjucks page template. To do this, set the cspNonce Nunjucks variable. However, you should only add this attribute if you're not able to include the hash for the inline scripts in your CSP.

Make sure you understand the security implications of using this attribute, as wrong implementation could affect your service’s security.

Read more about how to configure your CSP to work with GOV.UK Frontend.

This was added in pull request #2245: Allow the CSP nonce attribute to be set on the inline script in the page template. Thanks to @natcarey for contributing this issue and its solution.

Fixes

We've made the following fixes in pull request #2229: Change approach to fallback PNG in the header to fix blank data URI from triggering Content Security Policy error:

  • fix blank data URI from triggering CSP error
  • fix alignment of fallback PNG in the header

We’ve also made fixes in the following pull requests:

3.12.0 (Feature release)

New features

Links are easier to read and have a clearer hover state (opt-in)

Links now have underlines that are consistently thinner and a bit further away from the link text.

Links also have a clearer hover state, where the underline gets thicker to make the link stand out to users.

These changes are an opt-in feature because you may:

To enable this feature, set $govuk-new-link-styles to true before you import GOV.UK Frontend in your Sass:

// application.scss
$govuk-new-link-styles: true;
@import "govuk-frontend/all";

If you have created your own link styles, you should review them to ensure their use is consistent across your service.

To make it easier to be consistent in your use of link styles, we’ve also introduced new mixins and modifier classes for:

  • removing underlines
  • displaying white text on dark backgrounds

These new link styles will be enabled by default in a future major version of GOV.UK Frontend.

This was added in pull request #2183: Updates to link styles and link hover states.

Style links to remove underlines

You can now remove underlines from links by using either the:

An underline still appears when the user hovers their cursor over the link.

This was added in pull request #2214: Add no-underline mixin and modifier class.

Style links on dark backgrounds

You can now style links on dark backgrounds to use white text colour by using either the:

This was added in pull request #2213: Add inverse link mixin and modifier class.

Add links styled as buttons to cookie banners

You can now add links styled as buttons to cookie banners. For example, you can set the Hide button to be a link styled as a button that reloads the page. Use this feature if you set non-essential cookies on the server and want to help users keep their place using progressive enhancement.

This feature is enabled by default.

This was added in pull request #2164: Enable cookie banner to set link styled as a button.

Fixes

3.11.0 (Feature release)

New features

Allow users to accept or reject cookies with a cookie banner

You can now use cookie banners to allow users to accept or reject cookies which are not essential for making your service work.

This was added in pull request #2131: Add cookie banner component and button groups.

Group buttons and links

You can now use a button group when you place two or more buttons together.

Any links you include within a button group now line up visually with the buttons.

Read more about button groups on the Design System’s button page.

This was added in pull request #2114: Add button groups for use in cookie banner.

Change the style of table captions

You can now make table captions larger or smaller by applying the govuk-table__caption--xl, govuk-table__caption--l, govuk-table__caption--m or govuk-table__caption--s classes.

This was added in pull request #2048: Add modifiers for table captions.

Fixes

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

3.10.2 (Patch release)

Fixes

We’ve made fixes to the fixtures you can use to check your HTML matches GOV.UK Frontend.

These changes were made in the following pull requests:

There are no other changes to GOV.UK Frontend in this release.

3.10.1 (Patch release)

Fixes

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

3.10.0 (Feature release)

New features

Update users with notification banners

You can now use notification banners to tell users about events that occur elsewhere in your service. For example, when they need to complete tasks.

This was added in pull request #1935: Create notification banner component.

Customise input mode in the date component

You can now change which keyboard type displays for mobile and tablet users. This enables users to enter characters other than numbers when they use the date input. To change the keyboard type, set the inputmode when you use the Nunjucks macro options.

This was added in pull request #1975: Enable custom inputmode for date input component. Thanks to @foaly-nr1 for contributing this issue.

3.9.1 (Fix release)

Fixes

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

3.9.0 (Feature release)

New features

Add a prefix or suffix to a text input component

You can now use prefixes and suffixes in the text input component to help users enter things like currencies and measurements.

This was added in pull request #1816: Add input prefix and suffix. Thanks to @simonwhatley and the GOV.UK Coronavirus Services Team.

Test if your HTML matches GOV.UK Frontend

You can now use our test fixtures to check you're outputting the same HTML that GOV.UK Frontend uses.

This was added in pull request #1925: Generate fixtures.json files for components on build:package. Thanks to everyone who fed back on our test fixtures proposal.

Customise navigation in the header component

If you use the header component with navigation, you can now:

  • customise the section's aria-label text
  • add navigation items without links
Customise aria-label text

You can use the new:

  • navigationLabel option to set the aria-label text for the navigation section
  • menuButtonLabel option to set the aria-label text for the button that hides or shows the navigation section on mobile

For example:

{{ govukHeader({
    navigationLabel: "Custom navigation section aria-label",
    menuButtonLabel: "Custom menu button aria-label"
}) }}

The default labels are now:

  • Navigation menu for navigationLabel
  • Show or hide navigation menu for menuButtonLabel

This was added in pull requests:

Add navigation items without links

To add a navigation item without a link, use the text or html option to add the item but do not use the href option.

For example:

{{ govukHeader({
    navigation: [
    {
      html: "<form method='post' action='url.com'>
              <input type='submit' class='app-logout-button-style' value='Log out' />
            </form>"
    }
  ]
}) }}

This was added in pull request #1921: Make it possible to exclude link from header navigation item.

Fixes

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

3.8.1 (Fix release)

Fixes

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

3.8.0 (Feature release)

New features

The secondary text colour is now darker

$govuk-secondary-text-colour and govuk-colour("dark-grey") are now darker so users can more clearly read hint text that uses the colour.

The colour now has a contrast ratio of 7:1 against a white background, and helps hint text meet the WCAG 2.1 (AAA) accessibility standard.

This was added in pull request #1827: Make dark grey darker.

Error styling for field border thickness is now the same with and without an error

The error styling for the:

  • text input, select and textarea components no longer makes the border thicker
  • file upload component no longer includes a border around the file upload input

This means it’s easier for users to tell the difference between a field with an error and a field that's focused.

When an error message is about several fields, make sure you're clear which field has the error. You must not rely on users being able to tell which field has the error styling.

This was added in pull request #1870: Reduce border width of form inputs in the error state.

Set spellcheck with a new option

You can now turn spellcheck on or off in the input, textarea and character count components using the new spellcheck option instead of the attributes option.

For example:

{{ govukInput({
    spellcheck: true
}) }}

This was added in pull requests:

Deprecated features

$govuk-border-width-form-element-error

From GOV.UK Frontend v4.0.0, you'll no longer be able to reference the $govuk-border-width-form-element-error Sass setting.

Change any references to $govuk-border-width-form-element-error in your Sass code so they reference $govuk-border-width-form-element instead.

This was changed in pull request #1870: Reduce border width of form inputs in the error state.

Fixes

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

3.7.0 (Feature release)

New features

Add extra spacing between list items

If a list is hard to read because the items run across multiple lines, you can now add extra spacing between list items using the new govuk-list--spaced class.

This was added in pull request #1775: Add list--spaced modifier. Thanks to @frankieroberto for raising this issue.

Use HTML for navigation items in the header

You can now use HTML for a navigation item in the header component, using the new html option.

This was added in pull request #1819: Add the ability to specify HTML for a navigation item. Thanks to @adamsilver.

Import settings, tools and helpers CSS in one line

You can now import node_modules/govuk-frontend/govuk/base, instead of importing settings, helpers and tools separately.

Sass now compiles faster

GOV.UK Frontend's Sass files now compile to CSS faster, because we've changed the way dependencies work when you import them.

If you already import node_modules/govuk-frontend/govuk/all in your Sass file, you do not need to do anything. Sass will automatically compile faster.

If you import specific parts of GOV.UK Frontend in your Sass file instead, you can now make Sass compile faster by importing base then a component's index file. This will avoid GOV.UK Frontend importing dependencies multiple times.

For example:

@import "node_modules/govuk-frontend/govuk/base";

@import "node_modules/govuk-frontend/govuk/core/all";
@import "node_modules/govuk-frontend/govuk/objects/all";

@import "node_modules/govuk-frontend/govuk/components/button/index";
@import "node_modules/govuk-frontend/govuk/components/footer/index";
@import "node_modules/govuk-frontend/govuk/components/header/index";

Find out more about importing CSS.

This was added in pull request #1804: Allow components to be imported without dependencies. Thanks to @kevindew for raising this issue.

Collapse breadcrumb component on mobile

You can now collapse the breadcrumb component on mobile using the new collapseOnMobile option, so it:

  • shows only the first and last items
  • does not wrap

This was added in pull request #1754: Add collapseOnMobile breadcrumbs flag. Thanks to @vanitabarrett and @miaallers.

Back links are easier to select

The back link component is now:

  • bigger, so it's easier to select if you're using a touch screen
  • more consistent with the design of the breadcrumb component

This was added in pull request #1753: Make back link arrow consistent with breadcrumb component. Thanks to @vanitabarrett and @miaallers.

Deprecated features

Importing from the core and overrides layers without base

If you import specific files from the core or overrides layers, you’ll now see a deprecation warning when compiling Sass if you do not import node_modules/govuk-frontend/govuk/base first.

To fix the warning, import node_modules/govuk-frontend/govuk/base first. For example:

@import "node_modules/govuk-frontend/govuk/base";
@import "node_modules/govuk-frontend/core/typography";

If you do not import node_modules/govuk-frontend/govuk/base first, your service will no longer work from GOV.UK Frontend v4.0.0.

This was added in pull request #1807: Warn if importing core, overrides without dependencies.

Fixes

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

3.6.0 (Feature release)

New features

Use colours with the tag component

You can now use colour with tags to help distinguish between different tags - or to help draw the user’s attention to a tag if it’s especially important.

This also means you should replace the .govuk-tag--inactive class with the .govuk-tag--grey class. .govuk-tag--inactive is now deprecated, and it will be removed in a future release.

Pull request #1711: Additional Tag modifier classes for different colours.

Hide elements when users print a page

You can now hide elements when users print a page, using the new govuk-!-display-none-print class.

Pull request #1723: Add display override for hiding content when printing.

The iff Sass function is now deprecated

You should no longer use the iff Sass function. The function is now deprecated, and it will be removed in a future release.

Pull request #1742: Deprecate iff function.

Fixes

3.5.0 (Feature release)

New features

Add classes to the character count component's count message

If you're using Nunjucks, you can now add classes to the character count component's count message using the countMessage.classes option.

Fixes

3.4.0 (Feature release)

New features

Add classes to the page wrapper

If you're using Nunjucks, you can now add classes to the page wrapper using the containerClasses variable.

Pull request #1626: Allow creating custom width containers and using them with template.

Set a custom width for wrappers

If you're using Sass, you can now use the govuk-width-container mixin to create a custom wrapper class with a specific width. You can then add that class to the following wrappers to override the width of the govuk-width-container class:

To create your custom wrapper class, include the govuk-width-container mixin. Pass in the width in pixels.

For example:

.app-width-container--wide {
  @include govuk-width-container(1200px);
}

If you’re using Nunjucks, you should then add your class using either the:

Use the $govuk-page-width Sass variable instead if all your pages are the same width.

Add attributes to the <body> element of a page

You can now add attributes to the <body> element of a page, by using the bodyAttributes variable in the page template.

Fixes

3.3.0 (Feature release)

New features

Allow lang to be set on <title> and <main> of template

You can now set the lang attribute in the title and main of page template.

This will help with scenarios where some of the elements, such as navigation and footer, are in English whereas the title and page content are in a different language.

Add new override class to hide elements

You can now use the .govuk-!-display-none override class to hide elements.

Visual updates to the warning text component

Align ‘Warning text’ icon with first line of the content fixing #1352 Some changes were made to the size and spacing of the icon to help with positioning.

Fixes

3.2.0 (Feature release)

New features

Add classes to the form group wrapper of the character count component

You can now add classes to the form group wrapper of the character count component.

govukCharacterCount({
  formGroup: {
    classes: 'app-character-count--custom-modifier'
  }
})

Fixes

3.1.0 (Feature release)

New features

Add attributes to the fieldset on the date input component

You can now pass attributes to add to the fieldset on the date input component.

Pull request #1541: Allow date input fieldset attributes to be set. Thanks to andrew-mcgregor for raising this.

Add ARIA role to the fieldset component

You can now pass an ARIA role to the fieldset component.

Pull request #1541: Allow date input fieldset attributes to be set.

Add inputmode to the input component

You can now pass inputmode to the input component.

govukInput({
  inputmode: 'email'
})

Fixes

3.0.0 (Breaking release)

Breaking changes

You must make the following changes when you migrate to this release, or your service may break.

Update file paths, attributes and class names

To make sure GOV.UK Frontend's files do not conflict with your code, we've moved our package files into a directory called govuk.

If you’re using Sass

Add govuk/ after govuk-frontend/ to @import paths in your Sass file.

For example:

@import "node_modules/govuk-frontend/govuk/all";

If you’ve added node_modules/govuk-frontend as a Sass include path, add govuk/ to your @import paths:

@import "govuk/all";
If you’re using Javascript

You must do the following.

  1. Update file paths.
  2. Update and add data-module attributes.
  3. Update CSS class names.
Update file paths

You must add govuk/ to your import paths.

If you're importing node_modules/govuk-frontend/all.js, change this import path to node_modules/govuk-frontend/govuk/all.js.

If you’re importing a specific path, add govuk/ after govuk-frontend/. For example, if you're importing the button component:

import Button from 'govuk-frontend/govuk/components/button/button'
Update and add data-module attributes

You do not need to do anything if you're using Nunjucks macros and the initAll function.

If you are not using Nunjucks macros, add a govuk- prefix to data-module attribute values. For example:

<div class="govuk-accordion" data-module="govuk-accordion">
...
</div>

The button and details components now also use the data-module attribute for initialisation. If you are not using Nunjucks macros, add:

  • data-module="govuk-button" to each <button> HTML tag
  • data-module="govuk-details" to each <details> HTML tag

If you're using your own JavaScript code to initialise components, add a govuk- prefix to any selectors that find components using the data-module attribute.

Pull request #1443: Ensure GOV.UK Frontend component selectors cannot conflict when initialised

Update CSS class names

You do not need to do anything if you're using Nunjucks.

If you're using HTML or custom JavaScript, change:

  • js-character-count to govuk-js-character-count
  • js-header-toggle in the GOV.UK Frontend header component to govuk-js-header-toggle

Pull request #1444: Renames js- css prefix to govuk-js-

If you’re using Nunjucks
  1. Change the list of paths in nunjucks.configure so that the only GOV.UK Frontend path is node_modules/govuk-frontend/:
nunjucks.configure([
  "node_modules/govuk-frontend/"
])
  1. If you've extended the page template, add govuk/ to the template path:
{% extends "govuk/template.njk" %}
  1. Change the import paths in your components so they include govuk/components/. For example:
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}
Update asset paths

In the assets path, add govuk/ after govuk-frontend/:

/node_modules/govuk-frontend/govuk/assets

If your code uses Express.js, you must also use the following code in your configuration file:

app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/govuk/assets')))

Pull requests:

Migrate to the new accessible focus states

The focus state of components now meets the new WCAG 2.1 level AA requirements.

You must update your component’s focus state to make your design consistent with our new focus styles.

If you've extended or created components, you can no longer use the govuk-focusable or govuk-focusable-fill Sass mixins.

If you're using govuk-focusable, you must remove it. There’s no direct replacement, so you must use our Sass variables to make your components consistent with GOV.UK Frontend.

If you're using govuk-focusable-fill, include the govuk-focused-text mixin inside your component's :focus selector. For example:

.app-component:focus {
  @include govuk-focused-text;
}

Pull requests:

Update colours

You can now use the following new colour variables that we've added to the colour palette:

  • dark-blue
  • dark-grey
  • mid-grey
  • light-grey

5 Sass colour variables no longer exist. Replace the following colour variables if you're using Sass:

Colour variable removed Suggested replacement
bright-red red
grey-1 dark-grey
grey-2 mid-grey
grey-3 light-grey
grey-4 light-grey

You should check the contrast ratio of your colours.

If you're not using Sass, change the values of the following colours:

Colour name Old value Replace with
purple #2e358b #4c2c92
red #b10e1e #d4351c
yellow #ffbf47 #ffdd00
green #006435 #00703c
grey-2 #bfc1c3 #b1b4b6
grey-3 #dee0e2 #f3f2f1
grey-4 #f8f8f8 #f3f2f1
light-blue #2b8cc4 #5694ca
blue #005ea5 #1d70b8
bright-red #df3034 #d4351c

We've also changed the background of the following components:

  • buttons - green instead of a custom green
  • confirmation panels - green instead of turquoise
  • links in their hover state - dark-blue instead of light-blue

If you're using legacy projects like GOV.UK Elements, you can keep your current colours by turning on compatibility mode.

Read our blog post about why we changed the colour palette

Pull request #1288: Update colour palette.

Check the new version of the font

The size and baseline of the Design System's font are now more consistent with other fonts. Text now aligns vertically in text boxes without you needing to adjust it.

If you've extended or created components, you should check that your text is still vertically aligned correctly.

If you're using GOV.UK Frontend and GOV.UK Template, you can turn on compatibility mode to keep using the font from GOV.UK Template.

Pull requests:

Update links from error summary components to radios and checkboxes

If you've linked from an error summary component to the first input in a radios or checkboxes component, the link will no longer work.

This is because the id of the first input no longer has the suffix -1.

If there are links back to radios or checkboxes components in your error summary component, remove -1 from the end of the href attribute.

Pull request #1426: Make radios and checkboxes components easier to link to from error summary

Update the markup for tabs

You do not need to do anything if you're using Nunjucks macros.

If you are not using Nunjucks macros, remove the govuk-tabs__tab--selected class from the first tab's link, then add the govuk-tabs__list-item--selected class to that link's parent list item.

For example:

<li class="govuk-tabs__list-item govuk-tabs__list-item--selected">
  <a class="govuk-tabs__tab" href="#tab1">
    Tab 1
  </a>
</li>

Pull request #1496: Update the focus state for tabs

Update start button icon

Start buttons have a new icon. Your start buttons will lose their current icons unless you replace the old icon with the new one.

If you're using Nunjucks:

  • set the isStartButton option to true
  • remove the .govuk-button--start class

For example:

govukButton({
  text: "Start now",
  href: "#",
  isStartButton: true
})

If you're using HTML, add the SVG code from the start button example in the Design System.

Pull request #1341: Add new start button icon

Adjust text alignment in tables

Text now aligns to the top of table cells. If you've used a different alignment in a table, you should use your own CSS styles to keep the alignment the same.

For example, to align text in the centre:

.app-table--vertical-align-middle .govuk-table__header,
.app-table--vertical-align-middle .govuk-table__cell {
  vertical-align: middle;
  ...
}

Pull request #1345: Set 'vertical-align:top' positioning on table headers and cells

Replace Sass mixins in grids

If you're using the @govuk-grid-column Sass mixin to create custom grid classes, you must remove the $class parameter.

If you're passing a class name, put the mixin inside your selector. For example:

.your-class-name {
  @include govuk-grid-column(...)
}

You can no longer use the govuk-grid-row mixin. You can replace it with the .govuk-grid-row class in your HTML.

You must also replace calls to the grid-width mixin with calls to the govuk-grid-width mixin.

Pull requests:

Rename the border width variable

If you use Sass and you’ve extended or created components that use the border width variable, rename $govuk-border-width-mobile to $govuk-border-width-narrow.

Pull request #1287: Rename border-width-mobile to reflect how it's used

New features

Add attributes to table headings

You can now add attributes like classes, rowspan and colspan to table row headers.

Pull request #1367: Allow for classes, rowspan, colspan and attributes on row headers. Thanks to edwardhorsford.

Use page wrapper auto spacing

You can now add the .govuk-main-wrapper--auto-spacing modifier class to your <main> element to add responsive padding to the top and bottom of the page.

This will add the correct amount of padding depending on if there are elements above the <main> element inside the govuk-width-container wrapper. Elements above the <main> element could include a back link or breadcrumb component.

If you need to control the spacing manually, use the .govuk-main-wrapper--l modifier instead.

The govuk-main-wrapper and govuk-main-wrapper--l Sass mixins are now deprecated. Contact us if you need to continue using these mixins.

Pull request #1493: Add automatic vertical spacing modifier for main wrapper

GDS Transport now falls back to Arial in Internet Explorer 8 (IE8)

IE8 will now use Arial instead of GDS Transport.

This is because IE8 requires a very large Embedded Open Type (.eot) font file for external fonts. Arial will take less time to render for IE8 users, who are likely to be on older computers.

Pull request #1434: Update font to use v2 of GOV.UK Transport font. Thanks to @Nooshu.

Fixes

2.13.0

🆕 New features

  • You can now override the visually hidden 'Support links' text in the footer by setting meta.visuallyHiddenTitle.

    (Pull request #1387)

🔧 Fixes

  • Secondary buttons and warning buttons now have the correct background colour when they're disabled.

    (Pull request #1392)

  • The crown logo image in the header now:

    • has height and width attributes set
    • aligns better with 'GOV.UK' in IE8

    (Pull request #1419)

2.12.0

🆕 New features:

  • Support custom attributes on summary list action links

    You can now use the attributes macro option to add additional HTML attributes to summary list action links.

    (PR #1372)

  • Support aria-describedby on all form fields

    All form fields now support an initial aria-describedby value, populated before the optional hint and error message IDs are appended.

    Useful when fields are described by errors or hints on parent fieldsets.

    (PR #1347)

🔧 Fixes:

  • Update colour for MHCLG

    Fixes the brand colour for MHCLG to their correct corporate "green" brand.

    (PR #1319)

  • Remove deprecated @else-if statement, replace with @else if

    (PR #1333)

  • Prevent the fallback PNG image for the crown in the header from being downloaded unnecessarily in Internet Explorer and Edge.

    (PR #1337)

2.11.0 (Feature release)

🆕 New features:

  • Add new secondary and warning button variants

    (PR #1207)

  • Add new govuk-shade and govuk-tint functions for creating shades and tints of colours.

    (PR #1207)

  • Add support for custom row classes on the summary list component (including support for some rows without action links)

    (PR #1259)

  • Ensure fieldset never exceeds max-width

    This fix ensures that both WebKit/Blink and Firefox are prevented from expanding their fieldset widths to the content's minimum size.

    This was preventing max-width: 100% from being applied to select menus inside a fieldset.

    See discussion in "Reset your fieldset" and raised by issue #1264

    (PR #1269)

🔧 Fixes:

  • Add various fixes to the summary list component:

    1. Fixes the 1px row height change when borders are removed Padding is now adjusted by 1px instead

    2. Fixes the text alignment when the actions column isn't added So the key column always stays at 30% width

    (PR #1259)

2.10.0 (Feature release)

🆕 New features:

  • Add smaller versions of radio buttons and checkboxes

    Thanks to @owenm6 for their help and support on this one.

    (PR #1125)

🔧 Fixes:

  • Prevent duplicate checkbox aria-describedby

    Addresses an edge case where a checkbox with a hint (but without a fieldset) is output with duplicate aria-describeby attributes. Fixes issue #1248.

    Thanks to @colinrotherham for fixing this issue.

    (PR #1265)

2.9.0 (Feature release)

🆕 New features:

🔧 Fixes:

  • Fix tabs bullet point character encoding issue when not enhanced

    Thanks Ed Horsford and Steve Sims for their help on this one.

    (PR #1247)

  • Update padding of govuk-main-wrapper

    This increases the padding of govuk-main-wrapper (on tablet and above) to be more inline with GOV.UK. When updating, your pages will have 10px more white space above and below the 'main' content area.

    (PR #1073)

  • Remove error-summary dependence on document.onload

    (PR #1215)

  • Ensure font is not loaded twice on slow networks

    This is only an issue for users that are using alphagov/govuk_template alongside GOV.UK Frontend.

    (PR #1242)

2.8.0 (Feature release)

Considerations for fixed components such as modals

We have been made aware that the change to force scroll bars to appear at all times can change the behaviour of some components such as modals.

If you're using your own components that rely on the overflow state of the document (such as modals) you should make sure you test those components when updating to this version.

🆕 New features:

  • Enable pattern attribute for input

    You can now set the pattern attribute on input fields using the component macros:

    {{ govukInput({
      name: "example",
      pattern: "[0-9]*"
    }) }}

    As well as pattern, custom attributes can also be added on day/month/year inputs (e.g. data-example) shown below:

    {{ govukDateInput({
      items: [
        {
          pattern: "[0-9]*",
          attributes: {
            "data-example": "value"
          }
        }
      ]
    }) }}

    (PR #1172)

  • Prevent horizontal jump as scrollbars appear

    As content vertical height grows (e.g. autocomplete results appear), browsers may add scroll bars causing the page to jump horizontally in position.

    To avoid this, re-introduce fix from GOV.UK Template: alphagov#1204

    (PR #1230)

  • Accommodate camera notches on new devices (iPhone X, Google Pixel 3 etc)

    On newer devices with "camera notches", browsers reserve a safe area in landscape orientation (known as pillarboxing) so content isn't obscured.

    To avoid this, support has been added for viewport-fit=cover as shown here: https://webkit.org/blog/7929/designing-websites-for-iphone-x/

    (PR #1176)

  • Prefix error messages with a visually hidden "Error:", to make it clearer to users of assistive technologies

    (PR #1221)

  • Prevent accidental multiple submissions of forms

    If a user double clicks a submit button in a form, we debounce this event and ignore the second click.

    HTML data attribute:

    <button class="govuk-button" data-prevent-double-click="true">
      Submit
    </button>

    Nunjucks macro:

    {{ govukButton({
      text: "Submit",
      preventDoubleClick: true
    }) }}

    (PR #1018)

🔧 Fixes:

  • Ensure that files within the core, objects and overrides layers can be imported individually

    Unlike components, the files within these layers did not previously import their dependencies (for example, most of them require the govuk-exports mixin but did not import it).

    We've also added tests to ensure that files within these layers can be imported and rendered to CSS without erroring, which should catch this in the future.

    Thanks to Alasdair McLeay for originally raising a PR to fix this.

    (PR #1235)

  • Ensure inset component does not misalign nested components

    Thanks to Paul Hayes for raising this issue.

    (PR #1232)

  • Improve word wrapping in summary list component

    Thanks to Edward Horsford and Lee Kowalkowski for their help on this one.

    Also thanks to Malcolm Butler for exploring a previous version of this fix.

    (PR #1220)

2.7.0 (Feature release)

🆕 New features:

  • Added config file for prototype kit.

    Added a configuration file for an experimental feature in Prototype kit to allow departments to use their own frontend alongside govuk-frontend

    Thanks @matcarey (HMRC) for this contribution

    (PR #1102)

  • Disable incorrect iOS/Edge text size adjustments

    To cater for non-responsive websites, iOS and Edge automatically increase font sizes (iOS in landscape, Edge in portrait on HiDPI displays).

    Since we have already considered typography at these device sizes, this feature is now turned off.

    (PR #1178)

🔧 Fixes:

  • Fix wrapping of long lines of text in summary list

    Thanks to @MoJ-Longbeard for raising the issue.

    (PR #1169)

2.6.0 (Feature release)

🆕 New features:

  • Enable autocomplete attributes for input components.

    You can now set the autocomplete attribute on input, date input and textarea components using the component macros.

    This was already possible to do with the attributes option but this change highlights the new WCAG 2.1 success criteria Identify Input Purpose which "is to ensure that the purpose of a form input collecting information about the user can be programmatically determined, so that user agents can extract and present this purpose to users using different modalities".

    See autofill for the full list of attributes that can be used.

    (PR #1146)

🔧 Fixes:

  • Include Accordion component in global namespace

    Accordion component was not exported and was therefore unavailable in global namespace

    (PR #1157)

  • Fix Checkboxes and Radios targeting selectors outside it's scope

    Thanks to @andysellick and @bilbof for helping us with this issue.

    (PR #1156)

  • Fixes styling of the accordion component when there is no JavaScript or it has been turned off

    Thanks @dankmitchell for reporting this issue (#1130)

    (PR #1149)

  • Remove hover state for accordion sections on mobile

    (PR #1148)

  • Fix container not being centered in IE8

    Since the header and the footer component use this container it also fixes centering for these components.

    (PR #1147)

  • Make gutters in the header consistent with the grid

    This means that the header will now line up with the grid.

    Thanks to @edwardhorsford for raising this issue.

    (PR #1144)

2.5.1 (Fix release)

🔧 Fixes:

  • Update summary list to simplify actions

    Only output actions in a list when there's multiple actions.

    (PR #1131)

2.5.0 (Feature release)

🆕 New features:

  • Accordion component 🎉

    Contributed by @frankieroberto, as well as @injms, @hannalaakso, @joelanman and others.

    The accordion component lets users show and hide sections of related content on a page.

    For more information see guidance.

    (PR #958)

  • Add desktop specific grid column widths

    This allow you to define different grid behaviour for the tablet and desktop breakpoints. For example, you can make a column two-thirds on desktop but expand to full-width on smaller tablet sized screens.

    (PR #1094)

  • Add summary list component

    This component was initially developed to allow us to build the 'check your answers' pattern.

    It is mostly the same as in the original pattern with some notable differences:

    • On smaller screens it wraps by default
    • It's possible to have multiple actions

    (PR #1065)

🔧 Fixes:

  • Update visually hidden class to fix ordering issue in VoiceOver OSX

    We have fixed an issue in VoiceOver OSX where using the govuk-visually-hidden class in links would result in the text being announced out of order.

    We also now recommend to use aria-label or aria-labelledby where appropriate.

    Thanks to @stevenaproctor and the accessibility team at HMRC for letting us know about this issue.

    (PR #1109)

  • Improve rendering in older Internet Explorer

    Added a meta tag to ensure that older IE versions always render with the correct rendering engine

    (PR #1119)

2.4.1 (Fix release)

🔧 Fixes:

  • Remove unused hint, error message and label imports from the Character Count component

    (PR #1087)

  • Warning text component, remove negative margin left and reduce padding left to match.

    (PR #1084)

  • Add 5px bottom margin to list items within lists that do not have bullets or numbers on mobile breakpoints to make each item visually distinct.

    (PR #1078)

  • Add error message attributes to all components

    (PR #1086)

2.4.0 (Feature release)

🆕 New features:

  • Scroll to label or legend when linked from error summary

    When users click links in the error summary, the corresponding label or legend will now be moved to the top of the viewport, rather than the input. This means that the context for the input remains on-screen.

    (PR #1056)

  • Label or legend are announced for NVDA users when navigating to an input from the error summary

    (PR #1056)

  • Allow form group classes on date, file upload, input, select and textarea

    All remaining form groups should allow additional classes, like with radios and checkboxes

    (PR #1059)

🔧 Fixes:

  • Remove implicit dependency on Element for classList

    (PR #1063)

  • Single field with error should have 'aria-describeby' attribute

    Although we discourage using checkboxes without fieldsets, this fix ensures that if there are no fieldset then the aria-describeby will still be usable by screenreaders by adding the element ids to the checkbox input elements 'aria-describeby' attribute.

    (PR #1054)

2.3.0 (Feature release)

🆕 New features:

  • Add important parameter to visually hidden sass mixins

    Optional parameter added to govuk-visually-hidden and govuk-visually-hidden-focusable mixins (defaults to true)

    (PR #1037)

  • Add support for attributes on table cells

    Can now use the familiar attrubutes: {} pattern to add various attributes such as id or data-attr to cells within tables

    (PR #1045)

  • Allow form group classes on radios and checkboxes

    We now provide a way to add classes to the radio and checkbox form-group wrapper

    (PR #1043)

🔧 Fixes:

  • Fix anchor links in tabs component panels

    (PR #1031)

  • Fix IE8 support in builds in the dist/ folder

    (PR #1035)

2.2.0 (Feature release)

🆕 New features:

  • Allow classes on table header and row cells

    Optional classes attribute can now be used on table header and row cell item in the Nunjucks macro

    (PR #1015)

  • Add character count component

    (PR #959)

🔧 Fixes:

  • Apply max-width to the <select> element

    The <select> element's width is governed by the widths of its <option>'s.

    When the text in the options grows large, the element can grow to > 100% of the width of its container and break the layout.

    (PR #1013)

  • Prevent product name in header from wrapping

    Currently the product name in the header wraps when the space shrinks which doesn't look great.

    Adding display: inline-table prevents that so that the product name as a whole drops to a new line when space is shrunk.

    (PR #1007)

  • Set text colour for radios divider

    (PR 1023)

  • Stop links styled as button from being dragged

    Moving the mouse over a link while its button is depressed causes the browser’s dragging behaviour to trigger (and prevents the click event from firing). This is contrary to how actual <button> elements work. This pull request makes the behaviour of links styled as buttons consistent with that of buttons.

    (PR #1020)

2.1.0 (Feature release)

🆕 New features:

  • Allow additional 'meta' content in the footer

    You can now pass additional 'meta' content (as meta.html or meta.text) which will appear below any meta links, above the OGL license. This is ideal for, for example, the 'Built by Department Name' colophon.

    (PR #990)

  • Allow attributes to be added to some child items in header, footer, breadcrumbs, tabs and error-summary components

    You can now pass additional attributes to links in header, footer, breadcrumbs, tabs and error-summary components

    (PR #993)

  • Fix issue with conditional form content and inline form controls

    When inline variant of form controls is used with conditional content, we force it to display block. This is to avoid breaking and confusing styling as it is a combination we don't recommend.

    (PR #970)

  • Add component options (arguments) as macro-options.json to package

    We want to be able to expose these options to GOV.UK Design System. This change includes them as yaml in src/components and adds a build step to transform them to JSON and copy them to package/components. It also adds a test to check if the copied files are valid JSON and contain expected attributes.

    (PR #998)

🔧 Fixes:

  • Fix mobile menu button submitting parent forms

    The menu <button> didn’t have an explicit type set, which meant that it defaulted to type=“submit”.

    This meant that if the header was inside a form (as it is in the Design System examples, but we can imagine other scenarios where this would be the case) clicking the menu button would submit the form.

    In most cases this would also cause the page to reload, which closes the menu.

    (PR #994)

  • Fix flash of unstyled content in tabs component

    (PR #1000)

  • Add 48px favicon

    Microsoft recommends including at least a 48x48px favicon.

    (PR #986)

  • Update browsersList in package.json to reflect our supported browsers

    browsersList is used by PostCSS in our current build to determine which browser prefixes or rules to generate for the built CSS files. This PR adds rules to specify that the browsers in our browser matrix should always be prefixed for. Additionally, any browser with more than 0.1% of the global market share is prefixed for.

    In terms of changes to our built CSS, this means that -webkit-box-sizing and -webkit-box-shadow prefixes will be removed - neither of these prefixes are required by desktop Safari 5.1 or later so this seems a fairly safe change to make.

    (PR #1002)

2.0.0 (Breaking change)

💥 Breaking changes:

  • Set panel component's title heading level to 1 as default

    We think the panel title should be the h1 in the majority of cases, so we made it the default.

    If you have need to change the Panel component heading to something other than h1, you can do so by specifying headingLevel: <number> in the Nunjucks macro.

    (PR #967)

  • Remove deprecated govuk-visually-hidden-focussable class name

    In 1.1 release we added a new, correctly spelt govuk-visually-hidden-focusable CSS class and marked the old one as deprecated.

    To migrate you need to change govuk-visually-hidden-focussable to govuk-visually-hidden-focusable in your codebase.

    (PR #968)

  • Remove name-based width logic from date-input component

    In 1.1 release we removed styling which made the year field 4 characters wide, but was coupled to the field's name.

    However, to avoid making this a breaking release, we added logic to automatically add the width classes based on the name.

    We are now removing this behaviour. Instead, users need pass explicit classes for each field in the items object for the desired width of the input field.

    If you are not passing items at all, you will get the default items which include these classes.

    If you are using the Nunjucks macro, you need to provide a width class for each item, for example:

    {{ govukDateInput({
      "id": "dob",
      "name": "dob",
      "fieldset": {
        "legend": {
          "text": "What is your date of birth?"
        }
      },
      "items": [
        {
          "name": "day",
          "classes": "govuk-input--width-2"
        },
        {
          "name": "month",
          "classes": "govuk-input--width-2"
        },
        {
          "name": "year",
          "classes": "govuk-input--width-4"
        }
      ]
    }) }}
    

    If you are using plain HTML, you need to manually add a width-based class, such as govuk-input--width-2 or govuk-input--width-4 to the input fields.

    (PR #969)

  • Rename name argument of date-input component to namePrefix.

    This is better reflective of the purpose of the argument, which is to prefix the name attribute of items. This is consistent with other components which use the name idPrefix to explain similar functionality.

    If your project currently uses this optional argument with the date-input macro, you need to rename all instances of it to namePrefix (NB: this argument shouldn't be confused with the items.{}.name attribute which hasn't changed.)

    (PR #984)

  • Turn off compatibility mode by default for GOV.UK Elements, GOV.UK Template, GOV.UK Frontend Toolkit

    You do not need to make any changes if you do not use these projects alongside GOV.UK Frontend.

    To migrate include the SCSS variables that correspond with the projects you depend on before importing GOV.UK Frontend styles into your app:

    // application.scss
    $govuk-compatibility-govukfrontendtoolkit: true;
    $govuk-compatibility-govuktemplate: true;
    $govuk-compatibility-govukelements: true;
    @import "govuk-frontend/all";

    (PR #981)

  • Turn on relative typography (rem) by default

    This allows for end-users to adjust GOV.UK Frontend components by setting their font size in their browser.

    If you are using GOV.UK Frontend on with no other frameworks this should not break your project.

    If you need to change this setting for compatibility with GOV.UK Elements, GOV.UK Template, GOV.UK Frontend Toolkit consider enabling compatibility mode.

    Otherwise, set $govuk-typography-use-rem to false before importing GOV.UK Frontend styles into your app:

    // application.scss
    $govuk-typography-use-rem: false;
    @import "govuk-frontend/all";

    (PR #981)

  • Remove anchor styling in govuk-lists

    This was an undocumented feature of lists.

    To migrate we recommend using adding .govuk-link class to any anchors within a govuk-list.

    If you would like to replicate this functionality without adding a class you can also enable global styles (Note: global styles are enabled by default in the GOV.UK Prototype Kit)

    (PR #985)

  • Remove the width declaration from the <select> component

    The <select> component’s width will now be defined by it’s content. This addresses some accessibility issues with the select being 100% wide by default. If you want to style your select to be 100% wide we have added a new override class .govuk-!-width-full to allow this.

    (PR #960)

  • Use text colour on focus for better contrast

    Updates the focus styles of links in GOV.UK Frontend so they pass WCAG contrast requirements.

    (PR #982)

🆕 New features:

  • Add a new width override class .govuk-!-width-full

    You can now override elements that have an undefined or smaller percentage width to be 100% width of their container.

    (PR #960)

  • Allow attributes on select items

    You can now provide attributes on select items attributes: { 'data-attribute': 'value' }

    (PR #977)

🔧 Fixes:

  • Textareas can now only be resized vertically, to prevent them being resized outside of their container bounds. Additionally, they now have a minimum height to prevent them being resized smaller than a text input.

    (PR #976)

  • Defend tables against GOV.UK Elements code (PR #983)

1.3.0 (Feature release)

🆕 New features:

  • Allow attributes on checkboxes/radios

    You can now provide attributes on checkbox and radio items attributes: { 'data-attribute': 'value' }

    (PR #942)

🔧 Fixes:

  • Fix incorrect panel title bottom margin with optional text

    Margin is only added when panel text is provided

    (PR #936)

  • Remove template whitespace

    Remove leading whitespace before the doctype in the page template. Some older browser will be forced into 'quirks mode' if there is whitespace before the doctype.

    (PR #949)

  • Remove additional dotted outline from focussed buttons in Firefox

    This was already the intended behaviour, but a minor typo (: rather than ::) meant that it wasn't being applied.

    (PR #951)

  • Update date input component to use display: inline-block (PR #938)

  • Change spacing relationship on default and small legends and hints (PR #940)

  • Adjust tag component padding to compensate for font spacing (PR #955)

1.2.0 (Feature release)

🆕 New features:

  • Allow for optional divider between radio items

    You can now provide a divider item (e.g "or") to separate items (PR #849)

  • Allow og:image meta tag url to be set independantly Image url for the opengraph image needs to be absolute and can now be overwritten by setting the assetUrl variable. (PR #847)

  • Only underline the logo in the header on underline when users have overridden colours in their browser, rather than it appearing underlined all the time (PR #926)

  • Allow for optional hint for each radio and checkbox item

    You can now pass a hint object (or add in html) to each radio and checkbox item to display the hint (PR #846)

  • Allow additional classes to be added to the radio and checkbox items

    You can now provide label: { classes: 'extra-class' } to each item.

    (PR #880)

🔧 Fixes:

  • Replace conflicting js-hidden class used within the tabs component with a new modifier class. Because this class is defined and used within the JavaScript, no markup changes are required. (PR #916)

  • Use get-function when calling a Sass function as passing a string to `call()`` is deprecated and will be illegal in Sass 4.0 (PR #919)

  • Fix flash of unstyled content with conditional reveals (Radios and Checkboxes)

    If the conditional reveal JavaScript is slow to execute it can result in showing the user their contents briefly which can be jarring.

    (PR #885)

1.1.1 (Fix release)

🔧 Fixes:

  • Update details behaviour to remove margin-bottom for all elements (PR #900)

  • Update internal padding of tab content in the tabs component (PR #886)

  • Fixes an issue where clicking the revealed content in browsers that do not support the native details element causes the details element to collapse. (PR #912)

  • Fixes an issue where clicking the revealed content within a details element toggles the aria-expanded attribute on the summary element and the aria-hidden attribute on the content element, causing them to get out of sync with the visible state of the component. (PR #912)

  • Fixes an issue where it's not possible to make any field that does not have the name ‘year’ use any other width than 2 characters (PR #908)

  • Fix undefined class displaying in date input (PR #913)

1.1.0 (Feature release)

🆕 New features:

  • Add govuk-visually-hidden-focusable class

    Adds .govuk-visually-hidden-focusable and deprecates .govuk-visually-hidden-focussable in order to fix the typo in the class name. Please consider updating your code as the next major release will remove the deprecated class.

    (PR #859)

  • Allow panel component title heading to be customisable.

    You can now specify a heading level by providing headingLevel: <number> parameter. Default is 2. (PR #853)

  • Update date input component

    Allow the name and id attributes to be passed individually for each input item.

    Rely on classes instead of item names to set the width of input items.

    Add default (day, month, year) date input items if no items are being specified

    (PR #857)

  • The typography scale can now be converted from pixels to rem automatically, with pixels also being provided as a fallback for older browsers.

    This feature is disabled by default - in order to use it you will need to set $govuk-typography-use-rem: true and ensure that $govuk-root-font-size is set to the effective size of your root (html) element. For new projects, this should be the default of 16px so you don't have to do anything. For projects that use alphagov/govuk_template this should be 10px.

    The intention is to enable this by default in the next major version: alphagov#868

    (PR #858)

🔧 Fixes:

  • Remove mistakenly applied 5px bottom margin from radio and checkbox labels. (PR #883)

  • Apply display:block to .govuk-main-wrapper

    In IE11 main element is set to display:inline so padding and margins aren't applied. (PR #863))

  • Line-heights are now converted from pixels to relative 'unit-less' values in order to prevent issues when resizing text in the browser. (PR #837 and PR #848)

  • Add bottom margin to Tabs component All components (or outer layer components) have a bottom margin applied to them so spacing feels automatic. (PR #841)

  • Update Crown copyright link Update the Crown copyright link on the National Archives so we don't send users on an unnecessary redirect. (PR #824)

  • Fixes radio and checkbox labels extending full width of page (PR #821)

  • Prevent the exclamation mark in the warning text component from being selectable, which also excludes it when it is copied as part of a wider body of text (PR #856)

  • Add customised colours handling for warning text

    By adding a border to this component, when a user customises their colour settings they will still see a circle even if the background is removed. (PR #852)

  • Fixes a bug where the phase banner incorrectly uses a font-size of 19px when global styles are enabled (PR #877)

  • Add outlines to Radios and Checkboxes for customised colour users

    Now when a user customises their colours, they should see a focus state on both Radios and Checkboxes. (PR #854)

  • Add outline to tag for customised colour users

    Now when a user customises their colours, the tag component still keeps it's meaning. (PR #855)

  • Define size of table in px rather than em

    This brings the styling of tables inline with rest of GOV.UK Frontend which no longer uses em for measurements.

    This change very slightly increases the padding of table cells on mobile viewport as the use of em meant the font size set in the table was used to calculate padding. padding-top and padding-bottom of cells increase by 1.5px respectively which very slightly increases the height of the table on mobile.

    In the unlikely case that your UI has a dependency on tables being a certain fixed height of mobile viewport, this change might affect you.

    (PR #845)

  • Fix header component's reliance on markup whitespace

    We have had issues where the header component can render incorrectly if the markup contains whitespace, for example if it has been pretty printed.

    This changes the header component to use float based columns similar to how the grid system works.

    (PR #884)

🏠 Internal:

  • Fix Design System url in package READMEs and review app (PR #812)

  • Update back-link example to show default usage doesn't need text parameter (PR #819)

  • Lowercase component names (PR #822)

  • Tidy up some package.json fields to help contributors and users (PR #827)

  • Fix failing Heroku app with Node 10.5.0 Revert to pinning node version in package json (PR #833)

  • Format YAML and Nunjucks consistently (PR #830)

1.0.0 (Major release)

🆕 New features:

🔧 Fixes:

  • Reduce margin-bottom on the hint when following a default or small labe This reduces the margin-bottom of the hint by 5px after a default <label> or <label class="govuk-label--s">. (PR #806)

🏠 Internal:

  • Remove instructions to login with npm, which is no longer required (PR #795)

  • Update docs with the assistive technology we support (PR #800)

  • Update docs about installing fonts (PR #802)

  • Update browser support matrix Remove Windows Phone Update IE 8-10 to functional and IE 11 to compliant (PR #803

  • Add notice about the use of html arguments in Nunjucks macros for production (PR #785)

  • Add CHANGELOG_TEMPLATE to make changelogs easier for new contributors (PR #798)

  • Update package README (PR #804)

  • Update JavaScript installation instructions (PR #808)

0.0.32 (Breaking release)

This release changes the name of package. It's now published as govuk-frontend on npm.

💥 Breaking changes:

  • The default build of the GOV.UK Frontend JavaScript now does not initialize all components automatically.

    This allows you to initialize only the components you need, and gives you finer control over when the JavaScript for GOV.UK Frontend runs.

    To migrate your project you need to change

      <script src="{path-to-govuk-frontend}/all.js"></script>

    to

      <script src="{path-to-govuk-frontend}/all.js"></script>
      <script>window.GOVUKFrontend.initAll()</script>

    Now, if you only want to initialize a specific component you can now do so by:

      <script src="{path-to-govuk-frontend}/all.js"></script>
      <script>
        var Button = window.GOVUKFrontend.Button
        new Button(document).init()
      </script>

    Note: If you are importing JavaScript with a bundler, this is not likely to change anything for you. (PR #759)

  • Consistently structure the Details and Button component, so that they can be instantiated the same as the other components.

    If you're using GOVUKFrontend.initAll() you do not need to make any changes, otherwise you need to change

      <script>
        new Button().init()
        new Details().init()
      </script>

    to

      <script>
        new Button(document).init()
    
        var $details = document.querySelectorAll('details')
        nodeListForEach($details, function ($detail) {
          new Details($detail).init()
        })
      </script>

    (PR #761)

  • All sass-mq settings have now been made private. We are now exposing new settings to allow you to customise breakpoints and responsive behaviour:

    • $govuk-breakpoints - Map of breakpoint definitions
    • $govuk-show-breakpoints - Whether to show the current breakpoint in the top right corner
    • $govuk-ie8-breakpoint - Breakpoint to rasterize to for IE8

    If you are overriding any settings prefixed with $mq- in your application you will need to update to the use the new $govuk- prefixed settings.

    (PR #748)

  • Font settings have been renamed:

    • $govuk-font-stack has been renamed to $govuk-font-family
    • $govuk-font-stack-tabular has been renamed to $govuk-font-family-tabular
    • $govuk-font-stack-print has been renamed to $govuk-font-family-print

    (PR #748)

  • Spacing has been refactored. You will need to update Sass that currently uses GOV.UK Frontend spacing:

    • Instead of
    $govuk-spacing-scale-*

    use

    govuk-spacing(*)

    where * is the number on the spacing scale. The scale itself has remained the same so that $govuk-spacing-scale-3 corresponds to govuk-spacing(3). This change allows us to control the error messaging when incorrect values are used and to deprecate variables. The values of spacing variables can also be overridden by consumers.

    • Instead of:
    @include govuk-responsive-margin($govuk-spacing-responsive-2, "bottom");
    @include govuk-responsive-padding($govuk-spacing-responsive-2, "bottom");

    use

    @include govuk-responsive-margin(2, "bottom");
    @include govuk-responsive-padding(2, "bottom");

    This change, again, allows us to control the error messaging since spacing variables are not exposed directly. Also, the spacing scale itself has not changed so that $govuk-spacing-responsive-2 corresponds to 2 when passed to the padding and margin mixins.

    This PR also updates tests and sass-docs of spacing variables and helpers.

    Additionally, this PR hardcodes the value of $govuk-gutter, see PR for more details.

    (PR #779)

  • Remove pageStart block from template, as could result in rendering issues in older IE. (PR #765)

  • You should no longer call the mq mixin directly - you should replace any calls to it from your own code with govuk-media-query which accepts the same arguments. All mixins and settings that start with mq- should be considered private – they could be removed in the future without notice. (PR #763)

  • All of the shorthand 'font' mixins (e.g. govuk-font-bold-80, govuk-font-regular-tabular-19), have been removed and replaced with calls to a new mixin govuk-font. If you are using these mixins in your application you will need to update your code to call govuk-font instead.

    (PR #772)

  • The font maps are no longer as individual variables (e.g. $govuk-font-80) - they are all now part of one single $govuk-typography-scale map. Instead of passing font maps to govuk-typography-responsive you should now pass the desktop font size (e.g. govuk-typography-responsive(80) or govuk-typography-responsive($size: 80).

    (PR #772)

  • All organisation variables (e.g. $govuk-cabinet-office) have been moved into a single $govuk-colours-organisations map. If you need to use an organisation colour in your own code, you should use the new govuk-organisation-colour function:

    .element {
      color: govuk-organisation-colour(cabinet-office);
    }

    Note that this function will return 'web-safe' colours by default. You can pass $websafe: false to get the non-websafe colour.

  • The colour palette variables (e.g. $govuk-green) have been moved into a new single $govuk-colours map. If you need to reference a colour within your application you should use the new govuk-colour function:

    .element {
      color: govuk-colour("green");
    }

    Tints ($govuk-green-50, $govuk-green-25) have been removed from the colour palette.

  • A number of the colours have been renamed to use more neutral names:

    • mauvelight-purple
    • fuchsiabright-purple
    • baby-pinklight-pink
    • mellow-redbright-red
    • grass-greenlight-green
  • The 'circle shape' object (.govuk-circle) which was used by the warning text component's '!' icon has been removed and the govuk-warning-text__icon class has been updated to make it circular without the need for another class.

    (PR #782)

  • Removal of govuk-prose-scope We don't have confidence that the prose scope is well understood – without further research / better documentation it's safer to remove it for now.

    If you are currently using prose-scope, you should revert to applying classes to individual headings, lists and hr elements. In version 0.0.29-alpha release we have added the option to enable global link and paragraph styles.

    If you're using a recent version of the Private Beta Prototype kit, this is enabled by default.

    (PR #778)

  • Make override classes consistently verbose Based on feedback from the community we have made the override classes consistent where previously some where verbose and some where shorthand.

    We've made the decision to remove the 'r' for responsive, this was hard to remember and users found this confusing.

    To migrate you will need to replace any instances of:

    • .govuk-!-f-{size} with .govuk-!-font-size-{size}
    • .govuk-!-w-{weight} with .govuk-!-font-weight-{weight}
    • .govuk-!-m{direction}-r{scale} with .govuk-!-margin-{direction}-{scale}
    • .govuk-!-p{direction}-r{scale} with .govuk-!-padding-{direction}-{scale}

    For example if you were using:

    • .govuk-!-mb-r5 you would need to change this to .govuk-!-margin-bottom-5
    • .govuk-!-f-24 you would need to change this to .govuk-!-font-size-24

    See the original Pull Request for the full list of classes before and after.

    (PR #786)

🔧 Fixes:

  • Fix govuk-equilateral-height function usage in shape-arrow helper (PR ##766)

  • The <label> element will now be omitted for form controls where no label text or html is provided. If you call the label component directly whilst passing neither text nor html, no HTML will be outputted. (PR #740)

  • Add govuk-main-wrapper to <main> element by default. (PR #742)

  • Use relative imports whenever a component imports another component, to allow for cases where users don't want to add the components folder itself to their nunjucks paths. (PR #743)

  • Update JavaScript global namespace from 'all' to 'GOVUKFrontend', we intend to allow users to initialize components from this namespace. (PR #747)

  • Tabular numbers will now correctly use the $govuk-font-family-tabular setting rather than being hardcoded to use NTA tabular. (PR #748)

  • Prevents focus from being lost to the inline SVGs in the header (the crown) and footer (the OGL logo) by marking them as non-focusable elements (PR #774)

  • Use the correct class name in bold label example (govuk-label--s rather than govuk-label--bold) (PR #784)

  • Update table of arguments for each component to ensure they're accurate. (PR #769)

  • Add explicit dependency on colour maps (PR #790)

🆕 New features:

  • Components are now available to use from the GOVUKFrontend global. You can now initialize individual components like so:
  <script>
    var Radios = window.GOVUKFrontend.Radios
    new Radios(document).init()
  </script>

(PR #759)

  • Add beforeContent block to the template, for content that does not belong inside <main> element. For example: Back links. (PR #742)

  • Most of the settings, helpers and tools layers is now documented using Sassdoc, with variables, functions and mixins being marked as private or public. (PR #748) (PR #762)

  • Most of the settings can now be overridden in your application (they are now marked as !default) (PR #748)

🏠 Internal:

  • Fix review application templates to give them the correct HTML structure. (PR #742)

  • Improve release steps (PR #745)

  • Reintroduce mistakenly deleted HTML5Shiv required for IE8 (PR #749)

  • Fix issues with canvas colour bleeding into main review page (PR #741)

  • Add header with service name and navigation variant to header README (PR #781)

0.0.31-alpha (Breaking release)

💥 Breaking changes:

  • The govuk-file-url helper has been renamed to to govuk-image-url. If you are using this function in your own styles you will need to update calls to it. (PR #726)

  • The $govuk-global-images variable has been renamed to to $govuk-images-path. If you are overriding this variable or using it in your own styles you will need to update your code to use the new variable name. (PR #726)

🔧 Fixes:

  • Namespacing SCSS exports with 'govuk' prefix to avoid clashes with exports in applications consuming GOV.UK Frontend (PR #732)

  • Fixes a bug whereby print styles were being 'rasterized' into the screen styles when generating the IE8 stylesheet (this is a bug in sass-mq, and has also been raised upstream – sass-mq/sass-mq#111). (PR #726)

  • Removed some duplicated CSS rules from the outputted CSS (PR #727)

  • Fixes a bug in IE8 where the button component did not have a shadow, by rendering the shadow using a border for IE8 specifically – IE8 does not support box-shadow (PR #737)

🆕 New features:

  • Change font delivery method from Base64 encoded strings to serving WOFF2, WOFF and EOT files as separate HTTP requests. You will need to ensure that you are serving the fonts from the assets folder as part of your application. (PR #726)

  • The font-face is now using font-display: fallback. This means that the fallback font (Arial) will be used if NTA doesn't download within 100ms. The browser will then swap to NTA as long as it loads within the short swap period. (PR #726)

  • You can now override the helpers used to generate image and font urls, for example if you are using sass-rails' asset-pipeline functionality. You can do this by setting $govuk-image-url-function and $govuk-font-url-function to the name of the function(s) you wish to use. See src/settings/_assets.scss for more information and examples. (PR #733)

  • Add boilerplate template, which is a Nunjucks replacement for GOV.UK Template. (PR #731)

🏠 Internal:

  • Improve release steps, based on doing a release (PR #725)

  • Fix majority of vulnerabilities flagged by npm audit (PR #712)

0.0.30-alpha (Minor release)

🔧 Fixes:

  • Update component readme files content (PR #704)

  • Fix panel body element rendering with no text (PR #707)

🆕 New features:

  • Add override classes to set display property to block, inline and inline-block (PR #694)

  • Add option to set CSS display property for govuk-shape-arrow mixin (PR #701)

  • Add header component (PR #695)

  • Add inset text component (PR #709)

  • Add ability to pass explicit name value to checkbox items (PR #719)

🏠 Internal:

  • Run tests in pre-release (PR #706)

  • Fix CI timeouts: run Jest single thread in TravisCI (PR #712)

  • Ensure 'after' tests are not ignored (PR #720)

0.0.29-alpha (Breaking release)

💥 Breaking changes:

  • Restructure project to enable it to be published as a single package

    The new project structure matches our ITCSS inspired layers and is published as a single package as @govuk-frontend/frontend.

    You will need to:

    • Update your npm dependencies to use @govuk-frontend/frontend
    • Update your SCSS import paths to match the new package name and folder structure.

    If you're importing everything at once:

    @import "node_modules/@govuk-frontend/frontend/all";

    If you're importing individual components:

    @import "node_modules/@govuk-frontend/frontend/components/button/button";

    See the main README for up-to-date installation instructions.

    (PR #680)

  • Error Messages and Hints have been moved out Label and Fieldset components.

    They are no longer nested within the label or legend. They are associated with the input or with the fieldset using aria-describedby.

    Hint has been made into a new component similar to Error Message.

    If you're using markup, you will need to update the old markup:

    <label class="govuk-c-label" for="national-insurance-number">
      National Insurance number
      <span class="govuk-c-label__hint">
        It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.
      </span>
      <span class="govuk-c-error-message">
        Error message goes here
      </span>
    </label>
    <input class="govuk-c-input govuk-c-input--error" id="national-insurance-number" name="national-insurance-number" type="text">

    With the new markup:

    <label class="govuk-label" for="national-insurance-number">
      National Insurance number
    </label>
    <span id="national-insurance-number-hint" class="govuk-hint">
      It’s on your <i>National Insurance card</i>, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.
    </span>
    <span id="national-insurance-number-error" class="govuk-error-message">
      Error message goes here
    </span>
    <input class="govuk-input govuk-input--error" id="national-insurance-number" name="test-name-3" type="text" aria-describedby="national-insurance-number-hint national-insurance-number-error">

    If you're using macros:

    The fieldset macro no longer accepts legendHintText or legendHintHtml - these parameters are now passed to the hint component which accepts text or html. The date-input, checkboxes and radios components have been updated to use the new Hint component.

    The label macro no longer accepts hintText or hintHtml - these parameters are now passed to the hint component which accepts text or html. The file-upload, input, select and textarea components have been updated to use the new Hint component.

    For example, this example macro call for a File Upload component:

    {{ govukFileUpload({
      "id": "file-upload",
      "name": "photo",
      "label": {
        "text": "Upload your photo",
        "hintText": "Your photo may be in your Pictures, Photos, Downloads or Desktop folder."
      }
    }) }}

    would now be:

    {{ govukFileUpload({
      "id": "file-upload",
      "name": "photo",
      "label": {
        "text": "Upload your photo"
      },
      "hint": {
        "text": "Your photo may be in your Pictures, Photos, Downloads or Desktop folder."
      }
    }) }}

    For more examples of the new markup and Nunjucks macros see the GOV.UK Design System Question Pages pattern

    (PR #681)

  • The date-input component now sets an explicit group role on the fieldset to force JAWS 18 to announce the error message and hint. (PR #681)

  • The label component macro now accepts an isPageHeading argument which determines whether the label itself should be wrapped in an h1:

    <h1 class="govuk-label-wrapper">
      <label class="govuk-label">What is your National Insurance number?</label>
    </h1>

    The .govuk-label-wrapper removes the margins from the heading so that the presence of the h1 has no effect on the styling of the label.

    (PR #684)

  • Added new modifier classes for labels to allow you to create a label that visually corresponds to the equivalent heading class (for example, a .govuk-label--xl will have the same font size and weight as a .govuk-heading-xl)

    (PR #684)

  • The arguments for a fieldset's legend have been rolled up into an object. For example, the following macro call:

    {{ govukFieldset({
      legendText: "What is your date of birth?"
    }) }}
    

    would now be:

    {{ govukFieldset({
      legend: {
        text: "What is your date of birth?"
      }
    }) }}
    

    The legend object can also accept new classes and arguments

    Components that use the fieldset component have been updated to reflect these changes.

    (PR #684)

  • The fieldset component has a new parameter legend.isPageHeading, which defines whether the legend text should be wrapped in an h1:

    <legend class="govuk-fieldset__legend">
      <h1 class="govuk-fieldset__heading">Have you changed your name?</h1>
    </legend>

    The .govuk-fieldset__heading class ensures that the <h1> inherits its properties from the legend, so that the presence of the h1 has no effect on its styling.

    (PR #684)

  • Added new modifier classes for legends to allow you to create a legend that visually corresponds to the equivalent heading class (for example, a .govuk-fieldset__legend--xl will have the same font size and weight as a .govuk-heading-xl)

    (PR #684)

  • Remove -c -o -h layer prefixes (PR #644) In user research and in feedback from Private Beta partners we learned that users didn't really understand what -o, -c and -h prefixes stand for or why they're useful.

    They also introduced additional cognitive load when composing classes, having to remember which suffix the classname contains.

    If you're using markup, you will need to:

    • Remove -o, -c and -h prefixes from class names in your markup

    For example, change:

    <button class="govuk-c-button">Save and continue</button>

    Into:

    <button class="govuk-button">Save and continue</button>
  • Simplify grid syntax and introduce grid-row and column mixins.

    Based on user research feedback we have simplified the grid classes to a more concise naming structure.

    You will need to:

    • Change grid class names in your markup

    For example, change:

    <div class="govuk-o-grid">
      <div class="govuk-o-grid__item govuk-o-grid__item--two-thirds">
        <!-- content -->
      </div>
      <div class="govuk-o-grid__item govuk-o-grid__item--one-third">
        <!-- content -->
      </div>
    </div>

    Into:

    <div class="govuk-grid-row">
      <div class="govuk-grid-column-two-thirds">
        <!-- content -->
      </div>
      <div class="govuk-grid-column-one-third">
        <!-- content -->
      </div>
    </div>

    We have also introduced two mixins to help generate additional or custom grid styles and widths, see original pull request for usage.

    (PR #665)

🔧 Fixes:

  • Remove redundant font-family declaration from the button component – this will also fix an issue where the button uses New Transport when printed instead of falling back to the print stack as expected. (PR #650)

  • Reinstate focus outline for radios and checkboxes on IE8 (PR #670)

  • Fix section break styles when used with GOV.UK Elements (PR #682)

  • Remove -webkit-tap-highlight-color from links (PR #692)

  • Remove normalize from /dist builds (PR #699)

🆕 New features:

  • We're now using ES6 Modules and rollup to distribute our JavaScript. (PR #652)

  • Checkboxes and Radios conditional reveal (PR #616)

  • Vendor-in SassMQ functionality, write tests and remove external dependency (PR #657)

  • Focus Error Summary on window load (PR #671)

  • Opt-in Global <a> and <p> styles (PR #658)

    Global styles are not included by default.

    This is to avoid the risk of these globals conflicting with any pre-existing globals, for example in GOV.UK Elements or GOV.UK Template.

    Hovever, we do include them in the GOV.UK Prototype Kit to speed up prototyping.

    To include global styles, you can set $govuk-global-styles variable to true.

🏠 Internal:

  • Remove unused step in travis.yml file (PR #690)
  • Update publishing docs (PR #651)
  • Wrap app.css in conditional comments in review app layout (PR #653)
  • Fix missing code highlight and remove duplicate layout (PR #663)
  • Exclude test related files from dist/ and packages/ copy task (PR #662)
  • Add test to check if Sass in packages compiles correctly after the build:packages task (PR #669)
  • Disable code syntax highlighting in IE8 (PR #675)
  • Simplify contents of the dist/ folder (PR #673)
  • Added tests to ensure that the settings, helpers and tools layers do not output CSS.

0.0.28-alpha (Breaking release)

Fixes incomplete release from packages/ and dist/ in 0.0.27-alpha release. Missing files were:

  • globals/tools/_compatibility.scss
  • globals/tools/_ie8.scss
  • globals/settings/_compatibility.scss
  • globals/settings/_ie8.scss

0.0.27-alpha (Breaking release)

💥 Breaking changes:

  • Removed an (undocumented) modifier govuk-c-radio__item--inline which made radio buttons inline, in favour of a new block-level modifier govuk-c-radios--inline which will automatically make all the radio buttons within that block inline. (PR #607)

  • Prefix $global-images variable (PR #615)

  • Simplified how we build stylesheets that target old versions of IE:

    • Removed styles that target IE6 and IE7
    • Replaced IE mixins with a simpler version for targeting IE8 specifically without having to specify versions
    • Add a new tool mixin to easily exclude styles when targeting IE8
    • Automatically set $mq-responsive based on the value of the $govuk-is-ie8 variable.

    If you are building an IE8 stylesheet for your application you'll need to update it to reference the new variable $govuk-is-ie8 – see the README for details. (PR #631)

  • Rename captionSize table argument to captionClasses (PR #643)

🔧 Fixes:

  • Link styles, as well as links within the back-link, breadcrumbs, button, error summary, footer and skip link components defend against the a:link:focus selector in GOV.UK Template, which was overriding focussed links to always use the dark blue link colour for text. (PR #609)
  • Fix table captions to allow heading classes (PR #633)

🆕 New features:

  • Add govuk-main-wrapper--l a variant of the main page wrapper to use when a design does not include back links, breadcrumbs or phase banners (PR #602)
  • Added a new .govuk-link--text-colour modifier to make links use the same colour as the text. (PR #609)
  • Introduce new mixins for link styles (muted links, text links) and update the existing link classes to use them (PR #609)
  • Introduce a new 'compatibility' mixin and settings to allow us to selectively include styles that 'counter' styles from the existing products (e.g. GOV.UK Template) (PR #609)
  • The back link, breadcrumbs and skip link have been updated to use the text style link mixin (PR #609)
  • Add limited width inputs (PR #626)
  • Add details polyfill. This is automatically initialised in the main JS. (PR #610)
  • Add button polyfill. This is automatically initialised in the main JS. #572)

Note: Our JavaScript work is ongoing. In the next release of GOV.UK Frontend both of our script will be modularised and split into common functions. This will allow you to use the polyfills in your bundler/build pipeline. For this reason, you might want to wait until the next release before adding these polyfill scripts into your project.

🏠 Internal:

  • Update check script for new components and tweak docs (PR #589)

  • Listen for development server on different port for tests (PR #622)

  • Fix date-input default example (PR #623)

  • Ensure we're testing error-messages in date-input (PR #625)

  • Explain npm link (PR #624)

  • Make Sass imports less broad (PR #617)

  • Update project README with user research findings (PR #617)

  • Update component READMEs to use import statement (PR #615)

  • Use promisify util instead of manual method (PR #639)

0.0.26-alpha (Breaking release)

💥 Breaking changes:

  • The error summary component now has a default bottom margin (PR #583)
  • Nest components correctly (PR #584)

🔧 Fixes:

  • Make section break line 1px instead of 2px (PR #585)

🆕 New features:

  • Add footer component (PR #569)

🏠 Internal:

  • Update pre-release step to check for new components (PR #574)
  • Ensure render function does not have undefined object (PR #587)
  • Fix components relying on global builds (PR #588)

0.0.25-alpha (Breaking release)

💥 Breaking changes:

  • The colour variable $govuk-fuschia has been replaced with a new variable with the correct spelling ($govuk-fuchsia) – thanks to @charlesrt for reporting. (PR #571)

🆕 New features:

  • The input macro now accepts a type which allows you to override the default type="text" (PR #568)

🔧 Fixes:

  • The transparent outline has been removed from the button, as it already has a transparent border which is visible when overriding colours in the browser (PR #552)
  • Redundant duplication on the start button variant has been removed as it is inherited from the main .govuk-c-button class (PR #552)
  • A fix to remove a black border from buttons in IE7 has been removed as we are not targeting IE7 for GOV.UK Frontend (PR #552)
  • The date input component now sets type="number" and pattern="[0-9]*" to match the previous implementation in Elements (PR #568)

🏠 Internal:

  • The logic to determine button text colour automatically has been removed and replaced with a new variable $govuk-button-text-colour (PR #552)
  • The button component now uses the focusable mixin (PR #552)
  • The button component Sass has been restructured so that e.g. pseudo-selectors are consistently nested within their parents (PR #552)
  • Fixes for the release process (PR #567)
  • Add HTML5-shiv to review app (PR #575)

0.0.24-alpha (Breaking release)

💥 Breaking changes:

  • Namespace existing mixins and functions ( PR #557)
  • The class .govuk-section-break__visible has been renamed to .govuk-section-break--visible as it is a modifier, not an element. (PR #547)
  • Simplify src/ folder structure, remove tree and string manipulations from gulp tasks (PR #545)

🆕 New features:

  • A new variable $govuk-input-border-colour has been introduced to define the border colour for inputs. The Input, Select and Textarea components have been updated to use it. (PR #551)

🔧 Fixes:

  • Removes media query display on body from compiled CSS (PR #560)

  • Fieldset legends now correctly use 'full black' text colour when printed (PR #544)

  • Radio and Checkbox components now explicitly use currentColor for their borders, rather than relying on inheriting it (PR #551)

🏠 Internal:

  • The 'prose scope' has been updated to extend only placeholder classes. The corresponding classes the prose scope extends have been updated to provide a placeholder class and separately create the concrete class. This allows us to be specific about which occurrences of the class are meant to be extended. (PR #550)
  • The sass-lint config has been updated to prevent the use of @extend with concrete classes. (PR #550)
  • Release process has been streamlined with fewer steps (PR #553)
  • Update govuk-section-break__visible new class name govuk-section-break--visible in the review app's Typography page. (PR #566)

0.0.23-alpha (Breaking release)

💥 Breaking changes:

  • Remove Cookie-banner and Previous-next components (PR #488, PR #523)
  • Remove unused colours from the 'applied' colour palette: (PR #525)
    • $govuk-panel-colour
    • $govuk-canvas-colour
    • $govuk-highlight-colour
    • $govuk-page-colour
    • $govuk-discovery-colour
    • $govuk-alpha-colour
    • $govuk-beta-colour
    • $govuk-live-colour
    • $govuk-error-background
    • $govuk-proposition-border
    • $govuk-proposition-active-nav
    • $govuk-footer-background
    • $govuk-footer-border-top
    • $govuk-footer-link
    • $govuk-footer-link-hover
    • $govuk-footer-text
  • Rename $govuk-button-colour-darken-15 to $govuk-button-shadow-colour to avoid tying it to a particular colour. (PR #525)

🆕 New features:

  • Button hover colour now has a semantic Sass name: $govuk-button-hover-colour (PR #406)
  • A new link variant has been added which removes the visited state, for cases where distinguishing between visited and unvisited links is not helpful (PR #446)
  • The responsive spacing and typography mixins will now throw an error if you try to use them with anything other than a spacing or font map respectively. (PR #447)
  • Add thematic break to typography and prose scope. This class is added to an <hr>, adds margin (xl, l and m). There is also an option to make the <hr> border visible or invisible. (PR #483)

🔧 Fixes:

  • Remove double margin from Date input component (PR #451)
  • Add top margin for nested lists (PR #464)
  • Remove regular font weight from link styles (PR #469)
  • Remove redundant 'govuk-c-border' div from the details component (PR #481)
  • Add govuk-c-select--error modifier class to the select component instead of relying on govuk-c-input--error (PR #506)
  • Allow error message and hint text to be passed to a select component without requiring a label parameter (PR #506)
  • Define size of inputs etc in px rather than em. (PR #491)
  • Remove scope=row attribute from non-th elements (PR 527)
  • Form components and fieldset now include govuk-o-form-group that sets left border for errors and a bottom margin. Add example of form errors to preview app (PR #591)

🏠 Internal:

  • Replace Mocha/Chai with Jest, re-enable task tests, add back-link component. Special thanks to @htmlandbacon and @tyom for sharing their approaches. (PR #455)
  • Add example of nested lists to typography and prose scope in review app (PR #464)
  • Add tests for tag component (PR #457)
  • Add tests for button component (PR #461)
  • Add tests for breadcrumbs component (PR #461)
  • Add tests for details component (PR #480)
  • Add tests for warning text component (PR #479)
  • Add tests for table component (PR #472)
  • Add tests for error-summary component (PR #489)
  • Add tests for radios component (PR #476)
  • Add tests for input component (PR #478)
  • Add tests for date-input component (PR #495)
  • Add tests for textarea component (PR #497)
  • Add tests for panel component (PR #500)
  • Add tests for skip-link component (PR #498)
  • Add tests for file-upload component (PR #504)
  • Add tests for error-message component (PR #507)
  • Add tests for phase-banner component (PR #505)
  • Add tests for label component component (PR #508)
  • Add tests for fieldset component (PR #509)
  • Add tests for select component (PR #506)
  • Add tests for checkboxes component (PR #513)
  • Add tests to make sure the examples pages render without errors #523
  • Add correct links to the guidance in the Design System in component READMEs (PR #528)

0.0.22-alpha (Breaking release)

💥 Breaking changes:

  • The link styles in the core layer no longer style a elements directly, but instead provide a govuk-link class which you will need to apply to links individually. (PR #427)
  • The link component has been removed from Frontend as the link styles have been moved to the core (PR #431)
  • Rename legal-text argument accepted by legal-text component to text (PR #431)
  • Rename legal-text component to warning-text (PR #431)

🆕 New features:

  • The prose scope has been extended to style links, which means links within the scope do not need the govuk-link class applied. (PR #427)
  • The muted link variant from the link component is now available as a core class (govuk-link--muted). (PR #427)

🔧 Fixes:

  • The error summary component allows users to pass HTML for an entry in the list again. (PR #428)
  • Error list entries in the error summary component no longer get wrapped in links when no href is provided. (PR #428)
  • Remove redundant 'resets' for link print styles (PR #427)
  • The back link, breadcrumbs, error summary, previous / next and skip link components have been updated to include explicit link styling, as they previously relied on the global link styles. (PR #427)
  • Adjust warning-text icon by 1px for New Transport

🏠 Internal:

  • Add prose scope example (PR #429)
  • Links within the review app and the examples have been updated to use the govuk-link class. (PR #427)
  • Improve documentation around publishing (PR #430)
  • Improve documentation around contributing (PR #433)
  • Remove readme content from review app (PR #482)

0.0.21-alpha (Breaking release)

Skipped 0.0.20-alpha due to difficulties with publishing.

💥 Breaking changes:

  • Rename ‘govuk-body-lede’ to ‘govuk-body-lead’. (PR #405)
  • Pluralise radio component (PR #388)
  • Pluralise checkbox component (PR #384)

🆕 New features:

  • Add width classes, which were based on form-control classes that were specific to form control in Elements. (PR #413)

🔧 Fixes:

  • Make buttons 40px high including box shadow (PR #416)
  • Fix focus outline style in Chrome and Safari (PR #414)
  • Remove contributors list from template, fix template markup and update README files (PR #403)
  • Generate breadcrumb chevrons using pseudo-elements (PR #407)
  • Fix undefined classes in date input macro (PR #410)
  • Add documentation for typography helpers / core, simplify syntax (PR #400)
  • Add adjacent styles for headings after lists (PR #408)
  • Allow line height to be overridden in typography helpers (PR #404)