Skip to content

Use consistent inset padding across components#1737

Open
paulrobertlloyd wants to merge 9 commits into
support/10.xfrom
consistent-component-padding
Open

Use consistent inset padding across components#1737
paulrobertlloyd wants to merge 9 commits into
support/10.xfrom
consistent-component-padding

Conversation

@paulrobertlloyd

@paulrobertlloyd paulrobertlloyd commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

Description

Fixes #1735.

Using 24px across the following components across all breakpoints:

  • (Care) card
  • Contents list
  • Error summary
  • Expander
  • Form group object
  • Inset text
  • Notification banner
  • Pagination
  • Tabs (panel)
  • Warning callout

File upload (#1556) will need the same values applied, once that is merged.

24px is a size that works well across all different components. It also works for components such as details and pagination where text with left padding can align with the global value, but not if it gets much bigger. While cards have reduced padding, this works better for cards within card groups with many columns.

I’ve added this as a global setting: $nhsuk-inset-size.

Take a look at the updated reference images for comparison.

In #1740 I added a page with components that have inset padding, and in this PR you can see this page with the inset spacing highlighted.

I’ve also aligned the design for mobile tab links to match that of the contents list; we may want to pull this out into a separate PR.

Checklist

Comment thread packages/nhsuk-frontend/src/nhsuk/components/tabs/_index.scss Outdated
@paulrobertlloyd
paulrobertlloyd force-pushed the consistent-component-padding branch from b03478c to acc44cc Compare December 10, 2025 20:59
@paulrobertlloyd
paulrobertlloyd temporarily deployed to nhsuk-frontend-pr-1737 December 10, 2025 21:00 Inactive
@paulrobertlloyd
paulrobertlloyd force-pushed the consistent-component-padding branch from acc44cc to 6c607ff Compare December 12, 2025 09:51
@paulrobertlloyd
paulrobertlloyd temporarily deployed to nhsuk-frontend-pr-1737 December 12, 2025 09:51 Inactive
@paulrobertlloyd
paulrobertlloyd force-pushed the consistent-component-padding branch from 6c607ff to 846d2ff Compare December 12, 2025 10:07
@paulrobertlloyd
paulrobertlloyd temporarily deployed to nhsuk-frontend-pr-1737 December 12, 2025 10:07 Inactive
@paulrobertlloyd
paulrobertlloyd force-pushed the consistent-component-padding branch from 846d2ff to f8fd933 Compare December 12, 2025 10:29
@paulrobertlloyd
paulrobertlloyd temporarily deployed to nhsuk-frontend-pr-1737 December 12, 2025 10:30 Inactive
@paulrobertlloyd
paulrobertlloyd force-pushed the consistent-component-padding branch from f8fd933 to e4d59ca Compare December 12, 2025 15:41
@paulrobertlloyd
paulrobertlloyd temporarily deployed to nhsuk-frontend-pr-1737 December 12, 2025 15:41 Inactive
@paulrobertlloyd
paulrobertlloyd force-pushed the consistent-component-padding branch from e4d59ca to db3dee9 Compare December 12, 2025 16:04
@paulrobertlloyd
paulrobertlloyd temporarily deployed to nhsuk-frontend-pr-1737 December 12, 2025 16:05 Inactive
@paulrobertlloyd
paulrobertlloyd force-pushed the consistent-component-padding branch from db3dee9 to d8940ba Compare December 12, 2025 16:24
@anandamaryon1

Copy link
Copy Markdown
Contributor

Happy with this as it stands @paulrobertlloyd ?

I'm thinking about getting this into v11.

@paulrobertlloyd

Copy link
Copy Markdown
Contributor Author

Happy with this as it stands @paulrobertlloyd?

Mostly. But one last thing… shouldn’t the padding for inset text align with that for details content and fields with an error, which share a very similar design?

In which case, this would mean the left padding for inset text would be reduced to 16px.

Before

before

After

after

Also, should we update the togglable overlay guides on this page so that they also visibly show the 24px inset size too?

@colinrotherham
colinrotherham force-pushed the consistent-component-padding branch from 57e2690 to d2f2fa6 Compare March 22, 2026 10:19
@colinrotherham
colinrotherham temporarily deployed to nhsuk-frontend-pr-1737 March 22, 2026 10:19 Inactive
@colinrotherham

Copy link
Copy Markdown
Contributor

Rebased, but a reminder to say the wider spacing (tablet) isn't great for tabs

Tabs_tablet

@anandamaryon1

Copy link
Copy Markdown
Contributor

Happy with this as it stands @paulrobertlloyd?

Mostly. But one last thing… shouldn’t the padding for inset text align with that for details content and fields with an error, which share a very similar design?

Looking at them together, yes. But, when looked at alone, or alongside other components, I feel 16px is too close for the inset text. With such a heavy blue border the added empty space is needed to make the text not feel cramped, in my opinion. And I feel this trumps consistency with those two specific other components because they are less likely to be used right next to an inset text.

Eg.

16px 24px
image image

Also, should we update the togglable overlay guides on this page so that they also visibly show the 24px inset size too?

Yeah that'd be helpful 👍

--

Rebased, but a reminder to say the wider spacing (tablet) isn't great for tabs

This isn't great is it, thanks @colinrotherham. Maybe it wouldn't be crazy to have the tabs not align, to maximise available space.

For example, 16px, similar to buttons:
image

@colinrotherham
colinrotherham force-pushed the consistent-component-padding branch from d2f2fa6 to 15d2584 Compare April 13, 2026 09:23
@colinrotherham
colinrotherham temporarily deployed to nhsuk-frontend-pr-1737 April 13, 2026 09:23 Inactive
@sonarqubecloud

Copy link
Copy Markdown

@anandamaryon1 anandamaryon1 added this to the v11.0.0 milestone May 18, 2026
@colinrotherham
colinrotherham changed the base branch from main to improve-sass-remove-sass-mq June 5, 2026 08:33
@colinrotherham
colinrotherham force-pushed the consistent-component-padding branch from 15d2584 to 4f032f5 Compare June 5, 2026 08:33
@colinrotherham

Copy link
Copy Markdown
Contributor

I've rebased this against #1961 and had another go at making pagination comply

We've still got issues with Tabs spacing and I'm still not sure about inset text versus error summary spacing

Tweaks to pagination

@colinrotherham

Copy link
Copy Markdown
Contributor

The narrower error summary spacing looks nice and compact for small form controls though:

Compact nested errors

@colinrotherham
colinrotherham force-pushed the improve-sass-remove-sass-mq branch from beefa14 to bac6737 Compare June 16, 2026 10:48
@colinrotherham
colinrotherham force-pushed the consistent-component-padding branch from 4f032f5 to 770602c Compare June 16, 2026 10:58
@colinrotherham
colinrotherham force-pushed the improve-sass-remove-sass-mq branch from bac6737 to 7131041 Compare June 23, 2026 13:06
@colinrotherham
colinrotherham force-pushed the consistent-component-padding branch from 770602c to bf4196d Compare June 23, 2026 13:35
Base automatically changed from improve-sass-remove-sass-mq to support/10.x June 23, 2026 14:31
@colinrotherham
colinrotherham force-pushed the consistent-component-padding branch from bf4196d to 10cb376 Compare June 23, 2026 14:32
@colinrotherham colinrotherham mentioned this pull request Jul 9, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure inset padding is consistent across components

3 participants