DSE-379 :: Typography hard cut and migration guide#183
DSE-379 :: Typography hard cut and migration guide#183diogo-filipe-costa wants to merge 7 commits intocodex/spacing-cutfrom
Conversation
Add a repo-local typography alias audit command that inventories semantic and legacy typography APIs, their current token basis, and local usage grouped by toolkit, site, and docs examples. Support optional org-wide GitHub code search via gh so maintainers can enrich the report with external consumer usage when rate limits allow. Extend the root lint script so the new audit tooling is checked alongside the existing Figma scripts.
Replace direct legacy typography mixin keys and direct heading classes across the toolkit and site with the Figma-aligned names. Remove direct alias support from the typography tools and utilities while keeping semantic typography APIs in place pending audit and design review. Bump @ourfuturehealth/toolkit to 4.5.0 and document the migration path in the changelog and upgrading guide.
Update the typography alias audit metadata to match the current Figma-aligned scale names. Align the recorded token basis and internal dependency descriptions with the renamed heading and body keys so the generated audit report reflects the real toolkit API.
Add a standalone migration guide for the v4.5.0 spacing, typography, and token changes. Cover both the monorepo and pre-monorepo upgrade tracks, including numeric typography utilities from v3.4.2 and the exact or intent-based replacements they require. Reduce the top-level upgrading section to a short summary and point consumers to the standalone guide as the authoritative reference.
Carry the QA-driven site example and docs fixes onto the stacked typography branch. Keep the spacing demo legible, fix stale typography examples and copy, refresh updated dates, and remove repeated showcase blocks so the docs remain a reliable validation surface.
8ed1bb8 to
3ee9289
Compare
4b69b24 to
28fef64
Compare
Remove the internal-only ofh-heading-xxs alias and route h6 directly to the heading-xs styles. Clean up the typography examples, migration guide, and alias audit so the remaining semantic typography inventory no longer includes the removed alias.
Remove the temporary typography alias audit script and root package hooks from the typography migration branch. Keep the semantic typography APIs unchanged, and narrow the PR scope to the direct typography hard cut plus consumer migration guidance.
There was a problem hiding this comment.
Pull request overview
This PR completes the DSE-379 typography “hard cut” by removing legacy direct typography aliases/classes across the toolkit and docs site, aligning all usage to the Figma-scale key names, and adding a comprehensive v4.5.0 consumer migration guide covering spacing, typography, and token changes.
Changes:
- Removed legacy direct typography alias support (mixin keys + utility aliases) and migrated toolkit/component SCSS to Figma-aligned typography keys.
- Renamed direct heading class surface (
ofh-heading-l/m/s→ofh-heading-lg/md/sm) and updated site/docs examples accordingly. - Added a standalone v4.5.0 migration guide and updated UPGRADING/CHANGELOG to reflect the new migration track.
Reviewed changes
Copilot reviewed 88 out of 88 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/toolkit/package.json | Bumps toolkit version to 4.5.0. |
| packages/toolkit/core/utilities/_typography.scss | Removes legacy numeric utility alias generation; utilities now follow typography scale keys. |
| packages/toolkit/core/tools/_typography.scss | Removes legacy size aliases and updates docs/examples for new key names. |
| packages/toolkit/core/tools/_mixins.scss | Updates mixin usage to new typography key (heading-md). |
| packages/toolkit/core/styles/_typography.scss | Renames heading placeholders/classes and updates internal typography mixin keys; removes ofh-heading-xxs. |
| packages/toolkit/core/styles/_lists.scss | Updates list typography key to list-md. |
| packages/toolkit/core/elements/_table.scss | Updates paragraph key and caption heading key. |
| packages/toolkit/components/textarea/_textarea.scss | Updates to paragraph-md. |
| packages/toolkit/components/task-list/_task-list.scss | Updates to paragraph-md. |
| packages/toolkit/components/tag/_tag.scss | Updates to paragraph-sm. |
| packages/toolkit/components/summary-list/_summary-list.scss | Updates to paragraph-md. |
| packages/toolkit/components/summary-list/README.md | Updates examples to semantic body class ofh-body-m. |
| packages/toolkit/components/status-flag/_status-flag.scss | Updates heading/body font keys. |
| packages/toolkit/components/select/_select.scss | Updates to paragraph-md. |
| packages/toolkit/components/radios/_radios.scss | Updates to paragraph-md for items/divider. |
| packages/toolkit/components/pagination/_pagination.scss | Updates lead/paragraph-small keys to lead-md/paragraph-sm. |
| packages/toolkit/components/label/_label.scss | Updates label and heading modifiers to new heading keys. |
| packages/toolkit/components/input/_input.scss | Updates input font key to paragraph-md. |
| packages/toolkit/components/images/_images.scss | Updates caption key to paragraph-sm. |
| packages/toolkit/components/hint/_hint.scss | Updates to paragraph-md. |
| packages/toolkit/components/header/_header.scss | Updates navigation/service-name font keys. |
| packages/toolkit/components/footer/_footer.scss | Updates footer font keys to paragraph-sm. |
| packages/toolkit/components/fieldset/_fieldset.scss | Updates legend font keys and heading modifier sizes. |
| packages/toolkit/components/error-summary/_error-summary.scss | Updates title/body font keys. |
| packages/toolkit/components/error-message/_error-message.scss | Updates error message font key. |
| packages/toolkit/components/details/_details.scss | Updates body typography key and contextual heading placeholder reference. |
| packages/toolkit/components/checkboxes/_checkboxes.scss | Updates item/divider font keys to paragraph-md. |
| packages/toolkit/components/card/card.scss | Updates heading adjacency selectors and card heading font key. |
| packages/toolkit/components/card/README.md | Updates heading classes and replaces old numeric font-size utilities with new key-based utilities. |
| packages/toolkit/components/button/_button.scss | Updates button typography key to heading-xs. |
| packages/toolkit/components/breadcrumb/_breadcrumb.scss | Updates breadcrumb font key to paragraph-sm. |
| packages/toolkit/components/back-link/_back-link.scss | Updates back-link key to paragraph-sm. |
| packages/toolkit/components/action-link/_action-link.scss | Updates action-link font key to heading-sm. |
| packages/site/views/index.njk | Updates homepage card headings to ofh-heading-md. |
| packages/site/views/get-started/index.njk | Updates card heading classes to ofh-heading-md. |
| packages/site/views/examples/components/typography.njk | Updates typography example surface to new heading classes/keys; removes repeated blocks. |
| packages/site/views/examples/components/card/feature-card.njk | Updates heading class to ofh-heading-md. |
| packages/site/views/examples/components/card/clickable-card.njk | Updates heading class to ofh-heading-md. |
| packages/site/views/examples/components/card/card-with-image.njk | Updates heading class to ofh-heading-md. |
| packages/site/views/examples/components/card/card-group.njk | Updates heading classes and font-size utility classes to new key-based utilities. |
| packages/site/views/examples/components/all.njk | Updates all-component examples to new heading classes and font-size utility classes. |
| packages/site/views/design-system/styles/typography/sizes/index.njk | Replaces numeric font-size utilities with key-based typography utilities. |
| packages/site/views/design-system/styles/typography/index.njk | Updates typography guidance text and reflects new utility naming and scale values. |
| packages/site/views/design-system/styles/typography/headings/index.njk | Updates heading class examples to lg/md/sm surface. |
| packages/site/views/design-system/styles/typography/body-m/index.njk | Updates example from deprecated ofh-body to ofh-body-m. |
| packages/site/views/design-system/styles/spacing/width/index.njk | Updates headings to ofh-heading-md. |
| packages/site/views/design-system/styles/page-template/transactional/index.njk | Updates transactional template heading class to ofh-heading-lg. |
| packages/site/views/design-system/styles/page-template/index.njk | Updates guidance text to reference ofh-heading-lg. |
| packages/site/views/design-system/styles/colour/index.njk | Updates section headings to ofh-heading-md. |
| packages/site/views/design-system/patterns/a-to-z-page/panel/index.njk | Updates card heading utility from numeric to key-based (heading-md). |
| packages/site/views/design-system/patterns/a-to-z-page/navigation/index.njk | Updates A–Z navigation item font utility from numeric to key-based (heading-sm). |
| packages/site/views/design-system/patterns/a-to-z-page/default/index.njk | Updates A–Z pattern default template to key-based font utilities. |
| packages/site/views/design-system/components/skip-link/default/index.njk | Updates body class to ofh-body-m. |
| packages/site/views/design-system/components/error-summary/placement-multiple/index.njk | Updates page heading class to ofh-heading-lg. |
| packages/site/views/design-system/components/error-summary/placement-input/index.njk | Updates page heading class to ofh-heading-lg. |
| packages/site/views/design-system/components/error-summary/multiple-errors/index.njk | Updates page heading class to ofh-heading-lg. |
| packages/site/views/design-system/components/error-summary/link-input/index.njk | Updates page heading class to ofh-heading-lg. |
| packages/site/views/design-system/components/error-message/error-summary-placement-multiple/index.njk | Updates page heading class to ofh-heading-lg. |
| packages/site/views/design-system/components/error-message/error-summary-placement-input/index.njk | Updates page heading class to ofh-heading-lg. |
| packages/site/views/design-system/components/card/with-image/index.njk | Updates headingClasses to ofh-heading-md. |
| packages/site/views/design-system/components/card/index.njk | Updates docs text to reference ofh-heading-sm. |
| packages/site/views/design-system/components/card/heading-size/index.njk | Updates headingClasses to ofh-heading-sm. |
| packages/site/views/design-system/components/card/group-third/index.njk | Updates card groups to ofh-heading-md. |
| packages/site/views/design-system/components/card/group-quarter/index.njk | Updates quarter group heading HTML to key-based font-size utilities. |
| packages/site/views/design-system/components/card/group-half/index.njk | Updates card groups to ofh-heading-md. |
| packages/site/views/design-system/components/card/clickable/index.njk | Updates headingClasses to ofh-heading-md. |
| packages/site/views/design-principles.njk | Updates featured list heading classes to ofh-heading-lg. |
| packages/site/views/content/writing-for-readability.njk | Updates featured list heading class to ofh-heading-lg. |
| packages/site/views/content/standard-for-creating-health-content.njk | Updates featured list heading class to ofh-heading-lg. |
| packages/site/views/content/formatting-and-punctuation.njk | Updates “Research insight” heading class to ofh-heading-md. |
| packages/site/views/content/a-to-z-of-nhs-health-writing.njk | Updates date and A–Z navigation font utilities to key-based classes. |
| packages/site/views/_includes/_feedback-banner.njk | Updates feedback banner heading class to ofh-heading-md. |
| packages/site/styles/design-example/_design-example.scss | Updates design example pop-out typography key. |
| packages/site/styles/app/_side-nav.scss | Updates side-nav typography keys to Figma-aligned names. |
| packages/site/styles/app/_related-nav.scss | Updates related-nav typography keys to Figma-aligned names. |
| packages/site/styles/app/_page-contents.scss | Updates page contents typography keys. |
| packages/site/styles/app/_meta-data.scss | Updates meta-data typography key. |
| packages/site/styles/app/_lede-text.scss | Updates heading adjacency selectors to new heading classes. |
| packages/site/styles/app/_footer.scss | Updates footer typography key. |
| packages/site/styles/app/_contact-panel.scss | Updates contact panel heading key. |
| packages/site/styles/app/_colour-swatch.scss | Updates table typography key to paragraph-sm. |
| packages/site/styles/app/_beta-banner.scss | Updates beta banner typography key to paragraph-sm. |
| packages/site/components/header/_header.scss | Updates design-site header typography keys. |
| packages/site/components/footer/_footer.scss | Updates design-site footer typography keys. |
| packages/site/components/card/_card.scss | Updates design-site card typography keys and adjacency selectors. |
| docs/migrations/toolkit-v4.5.0-spacing-typography-tokens.md | Adds the standalone, detailed v4.5.0 consumer migration guide. |
| UPGRADING.md | Replaces detailed steps with a summary and link to the standalone migration guide. |
| CHANGELOG.md | Updates changelog entries to include typography hard cut + removals. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `all` spacing uses the vertical scale for top and bottom and the horizontal scale for left and right | ||
|
|
||
| ### Migration Steps | ||
| **Authoritative migration guide:** [Toolkit v4.5.0 spacing, typography, and token migration guide](/Users/diogo.costa/.codex/worktrees/5dbf/design-system-toolkit/docs/migrations/toolkit-v4.5.0-spacing-typography-tokens.md) |
There was a problem hiding this comment.
The migration guide link is an absolute local filesystem path, so it will be broken for anyone reading UPGRADING.md in GitHub. Replace it with a repo-relative link (e.g. docs/migrations/toolkit-v4.5.0-spacing-typography-tokens.md) or a full https GitHub URL.
| **Authoritative migration guide:** [Toolkit v4.5.0 spacing, typography, and token migration guide](/Users/diogo.costa/.codex/worktrees/5dbf/design-system-toolkit/docs/migrations/toolkit-v4.5.0-spacing-typography-tokens.md) | |
| **Authoritative migration guide:** [Toolkit v4.5.0 spacing, typography, and token migration guide](docs/migrations/toolkit-v4.5.0-spacing-typography-tokens.md) |
| "heading": "Dev toolkit (Github)", | ||
| "headingClasses": "ofh-heading-m", | ||
| "headingClasses": "ofh-heading-md", |
There was a problem hiding this comment.
Brand capitalization: “Github” should be “GitHub”.
| }) }} | ||
|
|
||
| <p>Vertical padding is reduced on transactional services using the <code>.ofh-main-wrapper--s</code> modifier class. We also recommended you use a smaller page heading size using the <code>.ofh-heading-l</code> modifier class.</p> | ||
| <p>Vertical padding is reduced on transactional services using the <code>.ofh-main-wrapper--s</code> modifier class. We also recommended you use a smaller page heading size using the <code>.ofh-heading-lg</code> modifier class.</p> |
There was a problem hiding this comment.
Grammar: “We also recommended you use …” should be “We also recommend you use …”.
| <p>Only use these font size overrides with <code>p</code> tags. | ||
| {{ designExample({ |
There was a problem hiding this comment.
The <p> opened here is not closed before the designExample(...) block, which produces invalid HTML and can break page layout/styling. Close the paragraph before the Nunjucks block (or restructure so the paragraph fully wraps only text).
Description
This PR delivers DSE-379 typography alignment across the toolkit and docs site.
It goes beyond a simple alignment with Figma. This branch removes the legacy direct typography aliases, removes the old direct heading class surface, updates utilities and docs to use only the newer Figma-aligned scale names, and adds migration guidance for consumers upgrading to the new typography and token model.
Ticket: DSE-379
Scope
v4.5.0migration guidance for the spacing, typography, and token changes in this migration track.Breaking Changes
ofh-typography-responsive(...)ofh-font(...)heading-xl,heading-lg,heading-md,heading-sm,heading-xslead-md,paragraph-md,paragraph-sm,list-md,list-smofh-heading-l->ofh-heading-lgofh-heading-m->ofh-heading-mdofh-heading-s->ofh-heading-smofh-heading-xxsalias and routedh6straight toheading-xsThe remaining semantic typography APIs are intentionally unchanged in this PR:
ofh-body-lofh-body-mofh-body-sofh-caption-*ofh-lede-text*Key Changes
1) Hard cut of the legacy direct typography API
l/m/stolg/md/smofh-heading-xxsalias and routedh6straight toheading-xs2) Consumer migration guidance for the full v4.5.0 change set
v4.5.0spacing, typography, and token changesv4.4.x -> v4.5.0v3.4.2 -> v4.5.0v3.4.2, such as:ofh-u-font-size-64ofh-u-font-size-48ofh-u-font-size-32ofh-u-font-size-24ofh-u-font-size-22ofh-u-font-size-19ofh-u-font-size-16ofh-u-font-size-143) Docs and examples refined as a real QA surface
ofh-bodyexamples and typography utility examples that were masking real regressionsValidation
pnpm lintnpm testReviewer Focus