v3.0.0
GOV.UK elements v3.0.0
This release includes two breaking changes, you'll need to amend your markup if you're using the GOV.UK elements styles for form validation and for custom radio buttons and checkboxes.
Breaking changes to form validation (#PR 405)
This adds two new classes: .form-group-error
and .form-control-error
, and removes the old .error
class. This lets specific controls within a group be accurately marked as having errors. For example, this allows parts of a date entry to be marked rather than the whole section.
To upgrade, you’ll need to change any occurrences of .error
that were applied to form groups to be .form-group-error
, and then add .form-control-error
to the failing input inside.
Radio buttons and checkboxes have new markup that doesn’t need JavaScript (PR #406)
Previously the radio buttons and checkboxes relied on selection-buttons.js (from govuk_frontend_toolkit) to work. By reworking the markup (see examples) we’ve been able remove this requirement.
To upgrade, you’ll need to change your markup to match the new pattern. Once that has been done you’ll be able to stop including selection-buttons.js and remove the GOVUK.SelectionButtons
constructor from your JavaScript.
The look and feel remains the same barring some tweaks to the focus weight. Accessibility and device compatibility remains the same as the previous version.
Fixes and improvements included in this release: