Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 24px from typography scale #1139

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

paulrobertlloyd
Copy link
Contributor

@paulrobertlloyd paulrobertlloyd commented Feb 14, 2025

Description

  • 24px is not listed as font size in the typography scale
  • The difference between 24px and 26px is slight, and having 3 sizes in the 22px - 26px range, reduces the contrast between heading sizes (which is why the medium heading size was increased from 24px to 26px last year).
  • The 24px font size is only used for a few components:
    • Panel headings (feature card, panel table, warning callout, do and don’t lists)
    • Pagination
    • Panel
    • Lede text (.nhsuk-lede-text)
    • Large text (.nhsuk-body-l)
  • Using 24px for panel headings means these don’t align with other headings on a page (and if you use nhsuk-heading-s and nhsuk-heading-m in combination with this component via headingClasses, you can soon wind up having cards with very similar but inconsistent heading sizes, as I’ve realised to my horror)

If you review the updated backstop images, you can see the overall change is slight.

I’ve removed 24px from the scale entirely, but doing so would mean nhsuk-font-size-24 in markup would no longer work and mixins calling the 24 size would throw an error. We have a few options for this, including around deprecating and providing 26px as a fallback. Before getting into that, I first wanted to get people’s thoughts on this change.

Related:

Checklist

@anandamaryon1
Copy link
Collaborator

I'm supportive. I left it in there whilst doing the typography edits last year because it was being used by the other components you listed. But you call out that in usage, it now means that various cards and styles can inconsistently use 24 or 26, I'm happy to consolidate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants