DSE-378 :: Spacing hard cut and token alignment#182
Open
diogo-filipe-costa wants to merge 6 commits intomainfrom
Open
DSE-378 :: Spacing hard cut and token alignment#182diogo-filipe-costa wants to merge 6 commits intomainfrom
diogo-filipe-costa wants to merge 6 commits intomainfrom
Conversation
✅ Deploy Preview for ofh-design-system-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Rename mismatched toolkit token names to the current Figma model and update breakpoint token definitions to match live variables. Split responsive spacing into horizontal and vertical scales and align typography and iconography token maps with the current design tokens. Prepare the toolkit helper and utility layers for the aligned token structure before the hard-cut migration work.
Update docs site styles that still referenced renamed toolkit tokens. Refresh the colour documentation to show the aligned token names. Keep the docs site output consistent with the toolkit token source changes.
Remove the legacy point-based spacing helper and legacy spacing utility generation from the toolkit core. Migrate toolkit and site spacing call sites to Figma-aligned responsive size keys and static -size-* tokens. Refresh spacing documentation and upgrade notes so consumers move to the new horizontal and vertical spacing scales.
Make the spacing demo legible on the docs site and explain what the standalone example is showing. Carry the spacing-specific QA refinements onto the spacing review branch without pulling in the later typography example cleanup.
8ed1bb8 to
3ee9289
Compare
There was a problem hiding this comment.
Pull request overview
Hard-cuts the toolkit and docs site over to Figma-aligned spacing (and related token/typography alignment), removing legacy point-based spacing helpers and updating utilities/mixins, source styles, and documentation/examples accordingly.
Changes:
- Replaced legacy
ofh-spacing(...)usage with$ofh-size-*tokens and updated responsive spacing to accept Figma-aligned size keys. - Split responsive spacing into horizontal/vertical scales and updated
allspacing behavior to use vertical for top/bottom and horizontal for left/right. - Updated typography scale keys to Figma-aligned names while adding aliases + utility classes to preserve legacy size names.
Reviewed changes
Copilot reviewed 132 out of 132 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/toolkit/core/utilities/_typography.scss | Adds legacy typography size utility aliases alongside new scale keys. |
| packages/toolkit/core/utilities/_spacing.scss | Updates spacing utility generation to iterate Figma-aligned responsive size keys. |
| packages/toolkit/core/tools/_typography.scss | Adds typography size alias resolution to support legacy keys with new scale keys. |
| packages/toolkit/core/tools/_spacing.scss | Reworks responsive spacing to use separate horizontal/vertical scales and new all behavior. |
| packages/toolkit/core/tools/_mixins.scss | Migrates internal mixin spacing usage to size keys/tokens. |
| packages/toolkit/core/styles/_typography.scss | Updates core typography styles to new spacing keys/tokens. |
| packages/toolkit/core/styles/_section-break.scss | Updates section-break spacing to Figma-aligned size keys. |
| packages/toolkit/core/styles/_lists.scss | Updates list spacing to Figma-aligned size keys. |
| packages/toolkit/core/settings/_tokens-static.scss | Renames secondary background tokens to backgrounds-* naming. |
| packages/toolkit/core/settings/_tokens-core.scss | Corrects blue-royal token naming and renames background neutral tokens. |
| packages/toolkit/core/settings/_tokens-breakpoint.scss | Splits responsive spacing into horizontal/vertical scales; renames typography scale keys; updates other responsive tokens. |
| packages/toolkit/core/objects/_main-wrapper.scss | Updates wrapper padding to Figma-aligned size keys. |
| packages/toolkit/core/objects/_form-group.scss | Updates form-group spacing to new tokens/keys. |
| packages/toolkit/core/elements/_table.scss | Updates table spacing to new responsive size keys. |
| packages/toolkit/core/README.md | Updates spacing utility documentation examples to new suffix keys. |
| packages/toolkit/components/textarea/_textarea.scss | Replaces ofh-spacing with $ofh-size-* token. |
| packages/toolkit/components/task-list/_task-list.scss | Updates component spacing to new tokens/keys. |
| packages/toolkit/components/tag/_tag.scss | Replaces ofh-spacing with $ofh-size-* tokens. |
| packages/toolkit/components/tables/_tables.scss | Updates table component spacing to new tokens/keys. |
| packages/toolkit/components/summary-list/_summary-list.scss | Updates summary-list spacing to new tokens/keys. |
| packages/toolkit/components/status-flag/_status-flag.scss | Updates status-flag spacing to new responsive size keys. |
| packages/toolkit/components/skip-link/_skip-link.scss | Replaces ofh-spacing with $ofh-size-* tokens. |
| packages/toolkit/components/select/_select.scss | Replaces ofh-spacing with $ofh-size-* token. |
| packages/toolkit/components/radios/_radios.scss | Replaces ofh-spacing with $ofh-size-* tokens and updates responsive spacing keys. |
| packages/toolkit/components/pagination/_pagination.scss | Replaces ofh-spacing with $ofh-size-* tokens and updates responsive spacing keys. |
| packages/toolkit/components/label/_label.scss | Replaces ofh-spacing with $ofh-size-* tokens. |
| packages/toolkit/components/inset-text/_inset-text.scss | Updates inset-text spacing to new responsive size keys. |
| packages/toolkit/components/input/_input.scss | Replaces ofh-spacing with $ofh-size-* token. |
| packages/toolkit/components/images/_images.scss | Updates image spacing/padding to new tokens/keys. |
| packages/toolkit/components/hint/_hint.scss | Replaces ofh-spacing with $ofh-size-* tokens. |
| packages/toolkit/components/hero/template.njk | Updates spacing utility class suffixes to size keys. |
| packages/toolkit/components/hero/_hero.scss | Migrates hero spacing to new tokens/keys. |
| packages/toolkit/components/hero/README.md | Updates hero docs examples to new spacing utility suffixes. |
| packages/toolkit/components/header/_header.scss | Replaces ofh-spacing with $ofh-size-* tokens and updates related comments/math. |
| packages/toolkit/components/footer/_footer.scss | Updates footer padding/border spacing to new tokens/keys. |
| packages/toolkit/components/fieldset/_fieldset.scss | Replaces ofh-spacing with $ofh-size-* tokens. |
| packages/toolkit/components/error-summary/_error-summary.scss | Updates error summary spacing to new responsive size keys. |
| packages/toolkit/components/error-message/_error-message.scss | Replaces ofh-spacing with $ofh-size-* token. |
| packages/toolkit/components/details/_details.scss | Replaces ofh-spacing with $ofh-size-* tokens and updates responsive spacing keys. |
| packages/toolkit/components/date-input/_date-input.scss | Replaces ofh-spacing with $ofh-size-* token. |
| packages/toolkit/components/contents-list/_contents-list.scss | Replaces ofh-spacing with $ofh-size-* token and updates responsive spacing keys. |
| packages/toolkit/components/checkboxes/_checkboxes.scss | Replaces ofh-spacing with $ofh-size-* tokens and updates responsive spacing keys. |
| packages/toolkit/components/character-count/_character-count.scss | Updates spacing to new tokens/keys. |
| packages/toolkit/components/card/template.njk | Updates spacing utility class suffix to size key. |
| packages/toolkit/components/card/card.scss | Replaces ofh-spacing with $ofh-size-* tokens and updates responsive spacing keys. |
| packages/toolkit/components/card/README.md | Updates examples to new spacing utility suffix keys. |
| packages/toolkit/components/button/_button.scss | Updates button spacing to new responsive size keys. |
| packages/toolkit/components/back-link/_back-link.scss | Replaces ofh-spacing with $ofh-size-* token. |
| packages/toolkit/components/action-link/_action-link.scss | Updates action-link spacing to new responsive size keys. |
| packages/site/views/index.njk | Updates spacing utility class suffixes to size keys. |
| packages/site/views/get-started/guidance-for-dev/index.njk | Updates spacing utility class suffixes to size keys. |
| packages/site/views/examples/standalone/landing/index.njk | Updates spacing utility class suffixes to size keys. |
| packages/site/views/examples/components/typography.njk | Updates spacing utility class suffixes to size keys. |
| packages/site/views/examples/components/card/card-group.njk | Updates spacing utility class suffixes inside card examples. |
| packages/site/views/examples/components/all.njk | Updates spacing utility class suffixes inside aggregated examples. |
| packages/site/views/design-system/styles/typography/index.njk | Updates spacing utility class suffixes used in side nav/back link layout. |
| packages/site/views/design-system/styles/spacing/text/index.njk | Updates spacing demo text utilities to size keys. |
| packages/site/views/design-system/styles/spacing/index.njk | Rewrites spacing guidance/docs for new size-key model and split scales. |
| packages/site/views/design-system/styles/spacing/default/index.njk | Updates spacing example markup to size keys + adds labels for QA legibility. |
| packages/site/views/design-system/styles/page-template/transactional/index.njk | Updates spacing utility class suffixes to size keys. |
| packages/site/views/design-system/styles/page-template/index.njk | Updates spacing utility class suffixes to size keys. |
| packages/site/views/design-system/styles/layout/index.njk | Updates spacing utility class suffixes to size keys. |
| packages/site/views/design-system/styles/icons/index.njk | Updates spacing utility class suffixes to size keys. |
| packages/site/views/design-system/styles/colour/index.njk | Updates spacing utilities and token names displayed in docs (backgrounds + blue-royal token). |
| packages/site/views/design-system/patterns/reassure-users-that-a-page-is-up-to-date/page/index.njk | Updates spacing utilities to size keys for review-date pattern page. |
| packages/site/views/design-system/patterns/reassure-users-that-a-page-is-up-to-date/index.njk | Updates spacing utilities to size keys for pattern content. |
| packages/site/views/design-system/patterns/reassure-users-that-a-page-is-up-to-date/default/index.njk | Updates spacing utilities to size keys in pattern example. |
| packages/site/views/design-system/patterns/mini-hub/index.njk | Updates spacing utilities to size keys in pattern guidance. |
| packages/site/views/design-system/patterns/mini-hub/example/index.njk | Updates spacing utilities to size keys in pattern example. |
| packages/site/views/design-system/patterns/mini-hub/example-symptoms/index.njk | Updates spacing utilities to size keys in pattern example. |
| packages/site/views/design-system/patterns/ask-users-for-their-nhs-number/filter/index.njk | Updates spacing utilities to size keys for hint spacing. |
| packages/site/views/design-system/patterns/ask-users-for-their-nhs-number/filter-third/index.njk | Updates spacing utilities to size keys for hint spacing. |
| packages/site/views/design-system/patterns/a-to-z-page/navigation/index.njk | Updates spacing utilities to size keys (margin/padding) for A–Z nav. |
| packages/site/views/design-system/patterns/a-to-z-page/default/index.njk | Updates spacing utilities to size keys in default pattern example. |
| packages/site/views/design-system/components/review-date/index.njk | Updates spacing utilities to size keys. |
| packages/site/views/design-system/components/radios/with-hints/index.njk | Updates spacing utilities to size keys for hint spacing. |
| packages/site/views/design-system/components/images/index.njk | Updates spacing utilities to size keys in component docs. |
| packages/site/views/design-system/components/hint-text/radios/index.njk | Updates spacing utilities to size keys for hint spacing. |
| packages/site/views/design-system/components/error-summary/placement/index.njk | Updates spacing utilities to size keys. |
| packages/site/views/design-system/components/error-summary/placement-multiple/index.njk | Updates spacing utilities to size keys. |
| packages/site/views/design-system/components/error-summary/placement-input/index.njk | Updates spacing utilities to size keys. |
| packages/site/views/design-system/components/error-message/error-summary-placement/index.njk | Updates spacing utilities to size keys. |
| packages/site/views/design-system/components/error-message/error-summary-placement-multiple/index.njk | Updates spacing utilities to size keys. |
| packages/site/views/design-system/components/error-message/error-summary-placement-input/index.njk | Updates spacing utilities to size keys. |
| packages/site/views/design-system/components/care-cards/index.njk | Updates spacing utilities to size keys. |
| packages/site/views/design-system/components/card/group-quarter/index.njk | Updates spacing utilities to size keys inside card examples. |
| packages/site/views/design-principles.njk | Updates spacing utilities to size keys in principles page layout. |
| packages/site/views/content/writing-for-readability.njk | Updates spacing utilities to size keys for featured-list layout. |
| packages/site/views/content/standard-for-creating-health-content.njk | Updates spacing utilities to size keys for featured-list layout. |
| packages/site/views/content/how-we-write.njk | Updates spacing utilities to size keys for inset text blocks. |
| packages/site/views/content/how-to-write-good-questions-for-forms/write-the-supporting-content-for-your-form.njk | Updates spacing utilities to size keys for hints/inset text. |
| packages/site/views/content/how-to-write-good-questions-for-forms/use-filter-questions-to-route-users.njk | Updates spacing utilities to size keys for images/hints. |
| packages/site/views/content/how-to-write-good-questions-for-forms/get-the-questions-into-order.njk | Updates spacing utilities to size keys for images. |
| packages/site/views/content/formatting-and-punctuation.njk | Updates spacing utilities to size keys for inset text blocks. |
| packages/site/views/content/a-to-z-of-nhs-health-writing.njk | Updates spacing utilities to size keys for A–Z nav. |
| packages/site/views/accessibility/partials/use-alternative-text-for-images-in-content.njk | Updates spacing utilities to size keys for image layout. |
| packages/site/views/_includes/app-layout.njk | Updates spacing utilities to size keys for “Updated” meta spacing. |
| packages/site/views/_includes/app-layout-two-thirds.njk | Updates spacing utilities to size keys for “Updated” meta spacing. |
| packages/site/views/_includes/_side-nav.njk | Updates spacing utilities to size keys for back-link spacing. |
| packages/site/views/_includes/_feedback-banner.njk | Updates spacing utilities to size keys for banner spacing. |
| packages/site/views/_includes/_contact-panel.njk | Updates spacing utilities to size keys for contact panel layout. |
| packages/site/styles/main.scss | Replaces ofh-spacing with $ofh-size-* tokens and updates responsive spacing keys. |
| packages/site/styles/design-example/_design-example.scss | Updates example layout spacing to size keys/tokens. |
| packages/site/styles/design-example-overrides.scss | Updates spacing example styling for clearer QA with new example markup. |
| packages/site/styles/app/_side-nav.scss | Migrates side nav spacing to new tokens/keys. |
| packages/site/styles/app/_related-nav.scss | Migrates related nav spacing to new tokens/keys. |
| packages/site/styles/app/_promo-video.scss | Replaces ofh-spacing with $ofh-size-* token. |
| packages/site/styles/app/_pane.scss | Replaces ofh-spacing with $ofh-size-* tokens and updates responsive spacing keys. |
| packages/site/styles/app/_page-contents.scss | Updates page-contents spacing to new responsive size keys. |
| packages/site/styles/app/_meta-data.scss | Replaces ofh-spacing with $ofh-size-* tokens. |
| packages/site/styles/app/_lede-text.scss | Replaces ofh-spacing with $ofh-size-* tokens. |
| packages/site/styles/app/_homepage.scss | Updates homepage section spacing to new responsive size keys. |
| packages/site/styles/app/_health-az.scss | Updates Health A–Z spacing to new tokens/keys. |
| packages/site/styles/app/_footer.scss | Updates footer spacing to new tokens/keys. |
| packages/site/styles/app/_featured-list.scss | Replaces ofh-spacing with $ofh-size-* tokens. |
| packages/site/styles/app/_example-callout.scss | Updates example callout spacing to new responsive size keys. |
| packages/site/styles/app/_container.scss | Replaces ofh-spacing with $ofh-size-* token. |
| packages/site/styles/app/_contact-panel.scss | Updates contact-panel spacing to new responsive size keys. |
| packages/site/styles/app/_colour-swatch.scss | Replaces ofh-spacing with $ofh-size-* tokens and updates responsive spacing keys. |
| packages/site/styles/app/_code-highlight.scss | Replaces ofh-spacing with $ofh-size-* tokens and updates responsive spacing keys. |
| packages/site/styles/app/_code-block.scss | Updates code block margin spacing to new responsive size keys. |
| packages/site/styles/app/_beta-banner.scss | Replaces ofh-spacing with $ofh-size-* tokens. |
| packages/site/components/inset-text/_inset-text.scss | Updates DS inset-text spacing to new responsive size keys. |
| packages/site/components/hero/template.njk | Updates spacing utility class suffixes to size keys. |
| packages/site/components/hero/_hero.scss | Updates hero spacing + background token to backgrounds-* naming. |
| packages/site/components/hero/README.md | Updates hero docs examples to new spacing utility suffixes. |
| packages/site/components/header/_header.scss | Updates header spacing + background token to backgrounds-* naming. |
| packages/site/components/footer/_footer.scss | Updates footer spacing to new tokens/keys. |
| packages/site/components/card/_inset-text.scss | Updates card inset-text spacing to new responsive size keys. |
| packages/site/components/card/_card.scss | Updates card spacing to new tokens/keys. |
| UPGRADING.md | Adds v4.5.0 migration guidance for spacing API hard cut. |
| CHANGELOG.md | Documents toolkit v4.5.0 release and breaking spacing changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update the responsive spacing type error so it reports the expected map type and points maintainers to the current breakpoint token source.
Update the spacing reference tables to show Desktop, Tablet, and Mobile in the same order designers use as the main size reference. Correct the override class guidance so the docs explain the real horizontal and vertical scale behavior instead of implying fixed values. Tighten the width override docs so they match the responsive utility output on mobile and tablet-plus screens.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR delivers DSE-378 spacing alignment across the toolkit and docs site.
It goes beyond a simple Figma rename pass. This branch removes the legacy point-based spacing helpers, utility suffixes, and old unified responsive spacing map so the toolkit uses only the current Figma-aligned spacing scales and token model.
Ticket: DSE-378
Scope
Breaking Changes
ofh-spacing(...)$ofh-spacing-points$ofh-space-responsive-scaleofh-responsive-margin(...)andofh-responsive-padding(...)now use the Figma-aligned size keys instead of point indicesallspacing now combines the vertical scale for top and bottom with the horizontal scale for left and rightKey Changes
1) Token groundwork for the spacing model
backgrounds-*namingblue-royal-4token naming so the token source matches the active design tokens$ofh-space-horizontal-responsive-scale$ofh-space-vertical-responsive-scale2) Hard cut of the legacy spacing API
ofh-spacing(...)helper from the toolkit core$ofh-size-*static tokenshorizontal,vertical, andallnow reflect the real split scales from Figma3) Docs and examples updated to teach the new spacing model only
Validation
pnpm lintnpm testReviewer Focus
horizontal,vertical, and especiallyall