GOV.UK Frontend v3.4.0
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:
containerClasses
variable in the page templatecontainerClasses
option in the header or footer
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
- Pull request #1594: Refactor handling of count message in character count JavaScript.
- Pull request #1609: Update hex value for secondary text to improve contrast.
- Pull request #1620: Only add underline to back link when href exists .
- Pull request #1631: Fix classes on character count when in error state.