[Snyk] Upgrade govuk-frontend from 4.3.1 to 4.8.0 #157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade govuk-frontend from 4.3.1 to 4.8.0.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 6 versions ahead of your current version.
The recommended version was released on 6 months ago.
Release notes
Package name: govuk-frontend
This release includes the ability to update the crown logo. You must do this between 19 February and 1 March 2024.
We’ll send reminders to our mailing list and cross-government Slack as soon as you can make this change.
New features
Update to the new GOV.UK logo (between 19 February and 1 March 2024)
We’ve updated the GOV.UK logo 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 to use the new crown.
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 are 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 orassetsPath
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.Update the logo in the header of your page
If you are using the
govukHeader
Nunjucks macro in your service, add theuseTudorCrown
parameter to the macro instantiation.If you are not using the Nunjucks macro, locate the HTML for the existing crown and replace it with this updated HTML. Make sure the URL for the new PNG fallback image is correct.
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:
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 controlsWe’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.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 thegovukAccordion
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 ButtonsWe’ve updated the Button Nunjucks macro to include an optional
id
parameter.This was added in pull request #3344: Adding optional ‘id’ attribute to button component.
Thanks to @ TomBillingtonUK 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 theclass
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
methodWe 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 buttonsWe 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:
govuk-if-ie8
andgovuk-not-ie8
mixins in your own Sass code (for example@ include govuk-if-ie8
)$govuk-is-ie8
and$govuk-ie8-breakpoint
settings to anything other than their default valuesIf 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:
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:
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:
hidden='until-found'
.js-enabled
page loadSource 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
andrelease-v4.4.0.zip
assets on GitHub releases:We've made fixes to GOV.UK Frontend in the following pull requests:
classList
polyfill from header component JavaScriptEvent
polyfill to accordion component JavaScriptImportant
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: