Skip to content

Releases: alphagov/govuk-frontend

GOV.UK Frontend v3.10.0

23 Nov 10:57
0ec483f
Compare
Choose a tag to compare

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.

GOV.UK Frontend v3.9.1

22 Sep 14:39
abe1672
Compare
Choose a tag to compare

Fixes

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

GOV.UK Frontend v3.9.0

14 Sep 12:16
6d1b0b7
Compare
Choose a tag to compare

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:

GOV.UK Frontend v3.8.1

13 Aug 12:30
eca3355
Compare
Choose a tag to compare

Fixes

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

GOV.UK Frontend v3.8.0

29 Jul 12:39
3e0da06
Compare
Choose a tag to compare

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:

GOV.UK Frontend v3.7.0

01 Jun 14:58
3932f5d
Compare
Choose a tag to compare

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:

GOV.UK Frontend v3.6.0

06 Mar 14:24
ce2a717
Compare
Choose a tag to compare

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

GOV.UK Frontend v3.5.0

GOV.UK Frontend v3.4.0

19 Nov 11:21
c668159
Compare
Choose a tag to compare

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

GOV.UK Frontend v3.3.0

07 Oct 12:20
c473c7e
Compare
Choose a tag to compare

This release contains some smaller features and bug fixes that include accessibility improvements.

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

Closes #1600