Skip to content

DSE-383 :: Foundation styles showcase#180

Draft
diogo-filipe-costa wants to merge 2 commits intomainfrom
codex/dse-383-foundation-styles-showcase
Draft

DSE-383 :: Foundation styles showcase#180
diogo-filipe-costa wants to merge 2 commits intomainfrom
codex/dse-383-foundation-styles-showcase

Conversation

@diogo-filipe-costa
Copy link
Contributor

@diogo-filipe-costa diogo-filipe-costa commented Mar 17, 2026

Description

This PR delivers DSE-383 Foundation styles showcase refresh for the docs site.

It rebuilds the foundation styles landing page plus the typography, spacing, layout, icons, and colour docs around a shared data-driven showcase layer so the displayed values stay aligned with the toolkit source of truth.

Release scope in this PR:

  • site/docs changes only
  • no @ourfuturehealth/toolkit version bump
  • no @ourfuturehealth/react-components version bump

Ticket: DSE-383

Breaking Changes

  • None.
  • No consumer API changes. This PR is limited to docs-site rendering, shared docs data generation, and documentation content.

Key Changes

1) Shared foundation showcase data layer

  • Added packages/site/scripts/foundation-styles-data.js to build a single foundationStyles data model for Eleventy
  • Parse the toolkit SCSS token and helper files directly so responsive typography, spacing, layout references, icon sizing rules, and colour values are derived from source instead of duplicated by hand in templates
  • Added packages/site/views/_data/foundationStyles.js so the foundation docs pages can all consume the same generated data

2) Reusable showcase templates and styling

  • Added shared Nunjucks partials for showcase matrices, visual scales, and colour groups under packages/site/views/design-system/styles/_partials/
  • Added packages/site/styles/app/_foundation-showcase.scss and wired it into the site app styles
  • Extended the existing colour-swatch styling so generated colour metadata such as source-token references can be displayed consistently

3) Foundation docs page refresh

  • Rebuilt /design-system/styles so it works as a real landing page for the foundation section
  • Updated /design-system/styles/typography to render a token-derived responsive type matrix while keeping the explanatory guidance and design examples in place
  • Updated /design-system/styles/spacing to render the responsive spacing scale and clarify static ofh-spacing() usage vs responsive spacing helpers
  • Updated /design-system/styles/layout to show generated breakpoint, width, and grid references alongside the existing guidance
  • Updated /design-system/styles/icons to keep the manifest-driven gallery and add clearer fixed-size vs responsive-size guidance
  • Updated /design-system/styles/colour to replace hardcoded swatches with generated semantic and palette group references while keeping the semantic-vs-core explanation handwritten
  • Updated the typography size override example page so it matches the utility class names generated by the current toolkit source

Validation

  • npm test
  • pnpm lint
  • pnpm --filter=site build
  • Manual QA on local docs routes for:
    • /design-system/styles
    • /design-system/styles/typography
    • /design-system/styles/spacing
    • /design-system/styles/layout
    • /design-system/styles/icons
    • /design-system/styles/colour

Reviewer Focus

  • Accuracy of the token-derived values shown across typography, spacing, layout, icons, and colour pages
  • Clarity of the distinction between generated references and handwritten guidance
  • Whether the responsive/static spacing guidance, semantic/core colour guidance, and breakpoint/width explanations are easier to follow than before
  • The usefulness of the new foundation styles landing page as an entry point for design review

Refs: DSE-383

Add a shared Eleventy foundation styles data source backed by targeted parsing of the toolkit SCSS tokens and helper files.

Introduce reusable showcase partials for matrices, scales, and colour groups so the foundation docs pages can render from a consistent structure.

Add the supporting site styles for the showcase patterns and extend the colour swatch styling for generated token metadata.
Refs: DSE-383

Rebuild the foundation styles landing page plus the typography, spacing, layout, icons, and colour docs around the shared showcase patterns.

Replace duplicated handwritten values with token-derived references where practical while keeping the existing editorial guidance and design examples in place.

Update the typography size override example so it matches the utility classes generated by the current toolkit source.
@netlify
Copy link

netlify bot commented Mar 17, 2026

Deploy Preview for ofh-design-system-docs ready!

Name Link
🔨 Latest commit a3c22fb
🔍 Latest deploy log https://app.netlify.com/projects/ofh-design-system-docs/deploys/69b9914f20d1590008d16ef3
😎 Deploy Preview https://deploy-preview-180--ofh-design-system-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Design System “Foundation styles” documentation pages to showcase typography, spacing, layout, icon sizing, and colour tokens using values derived directly from the toolkit SCSS sources (to keep docs aligned with the toolkit as tokens evolve).

Changes:

  • Introduces a foundationStyles Eleventy global data source built from parsing toolkit SCSS tokens.
  • Reworks foundation style pages (typography/spacing/layout/icons/colour) to render responsive matrices/scales from token-derived data.
  • Adds reusable Nunjucks partials and new SCSS to support the “foundation showcase” tables/cards UI.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/site/views/design-system/styles/typography/sizes/index.njk Updates typography size utilities list to named responsive tokens.
packages/site/views/design-system/styles/typography/index.njk Reworks typography docs to render a responsive typography matrix and token-derived values.
packages/site/views/design-system/styles/spacing/index.njk Replaces hardcoded spacing table with token-derived responsive scale showcase.
packages/site/views/design-system/styles/layout/index.njk Adds breakpoint/container/grid showcase tables driven by toolkit token data.
packages/site/views/design-system/styles/index.njk Updates Foundation styles landing page copy and adds token-driven navigation cards.
packages/site/views/design-system/styles/icons/index.njk Adds responsive icon size behaviour section with token-driven matrix.
packages/site/views/design-system/styles/colour/index.njk Replaces large hardcoded colour tables with grouped, token-driven rendering.
packages/site/views/design-system/styles/_partials/showcase-scale.njk New partial for rendering spacing/width scale tables.
packages/site/views/design-system/styles/_partials/showcase-matrix.njk New partial for rendering responsive “matrix” tables (typography/icons).
packages/site/views/design-system/styles/_partials/colour-group.njk New partial for rendering colour token groups.
packages/site/views/_data/foundationStyles.js Adds Eleventy global data hook that exposes foundationStyles.
packages/site/styles/app/_foundation-showcase.scss New styling for foundation showcase tables, previews, and landing cards.
packages/site/styles/app/_colour-swatch.scss Extends swatch table styling for the new “source token” column.
packages/site/styles/app/_app.scss Includes the new foundation showcase SCSS partial.
packages/site/scripts/foundation-styles-data.js Implements SCSS-token parsing and builds the foundationStyles data model.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

<h3>Reading width</h3>
<p>Lines of text should be no longer than 70 to 80 characters.</p>
<p class="rich-text">When using the fluid-width container or wider grid columns, wrap text content with <code>.ofh-u-reading-width</code> to apply a maximum width and limit the number of characters per line.</p>
<p class="rich-text">Use <code>.ofh-u-reading-width</code> to apply a maximum width of {{ foundationStyles.layout.widths[3].value }} to longer blocks of content.</p>
<h3>Tablet and mobile-specific grid classes</h3>
<p>By default, grid columns sizes will go to 100% width of the container on screen sizes below the desktop breakpoint, which is 769px. These utility classes will enforce column widths on all screen sizes.</p>
<p class="rich-text">To define the column sizes, add the utility class <code>.ofh-u-</code> followed by the width to an existing grid column. For example <code>.ofh-u-one-half</code> will set your column width to be one-half on all screen sizes.</p>
<p>By default, grid columns go to 100% width of the container on screen sizes below the desktop breakpoint, which is {{ foundationStyles.layout.breakpoints[2].value }}. These utility classes will enforce column widths on all screen sizes.</p>

<h3>Tablet-specific grid classes</h3>
<p>These utility classes will enforce column widths on screen sizes larger than the mobile breakpoint, which is 320px.</p>
<p>These utility classes will enforce column widths from the tablet breakpoint upwards, which is {{ foundationStyles.layout.breakpoints[1].value }}.</p>
min-height: 2px;
width: 14px;
}

Comment on lines +17 to +22
<th class="ofh-table__header" scope="col">Reference</th>
<th class="ofh-table__header" scope="col">Visual</th>
<th class="ofh-table__header" scope="col">Value</th>
<th class="ofh-table__header" scope="col">Class or token</th>
<th class="ofh-table__header" scope="col">Notes</th>
{% endif %}

<h3>Fixed-width container</h3>
<p class="rich-text">Use <code>.ofh-width-container</code> for a container with a maximum width of 960px.</p>
<p class="rich-text">Use <code>.ofh-width-container</code> for a container with a maximum width of {{ foundationStyles.layout.widths[1].value }}.</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants