Review global box-sizing usage for v11
#1711
Open
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.



This PR was recreated from #1633
It was reverted from v10 and is now ready for v11
Description
Globally setting
box-sizingusing best practice from a decade ago is causing problems in components, not least checkboxes and radios insidenhsuk-details__textwrappers.Best practice as of 2025 is to not set this value globally — certainly if starting a project from scratch, and using intrinsic layouts which don't use fixed widths.
An alternative approach is set this value globally using the
*selector, and not attempt to force inheritance. However, as this doesn’t encompass pseudo elements, this then means adding this value explicitly in such cases where it is needed.I tried removing the globalbox-sizingreset, but a number of tests failed. Although not beyond the realms of fixing, I have kept the global default forbox-sizingasborder-box, removed it from rules where it is inherited and kept it for the pseudo elements used to draw checkboxes and radios.The only visual differences are the space between the underlined NHS logo.I’ve chosen the former approach; not setting a global
box-sizingvalue and instead setting it where necessary. This is especially important as the globalbox-sizingwas never imported on a per-component basis.I’ve also added an example of small radios and checkboxes inside details elements… arguably this example page can now be removed, but maybe we want to keep it around for a while.
Checklist