Lab · OzzyOS

How my design system is wired

OzzyOS is the design system I'm building in public, for client marketing sites and SaaS apps. This post isn't about the components. It covers the services around them: what each one does, and how a change gets from my editor to an npm package.

  1. 01 · Design · plannedFigmaVariables synced with the token JSON by a private plugin
  2. 02 · SourceGitHubOne public repo: tokens, three packages, Storybook
  3. 03 · BuildTurborepo + Style DictionaryTokens and contrast gate, then CSS, React, Storybook
  4. 04 · CheckGitHub ActionsLint, typecheck, unit tests, axe on every story
  5. 05 · ReviewChromaticPublished Storybook and visual diffs on each pull request
  6. 06 · ReleaseChangesets + npmVersion PR, then publish with provenance. CSS also on jsDelivr
Every step from source to release runs on its own when I push. The Figma step is planned and not built yet.

One repository on GitHub

Everything lives in one public repository, bryoz/ozzyos. It's a monorepo managed with pnpm workspaces:

  • tokens/: the design decisions as JSON in the W3C design tokens (DTCG) format, layered from core values to semantic roles to client brands.
  • @ozzyos/tokens: builds that JSON into CSS variables, JavaScript and JSON.
  • @ozzyos/css: the framework-free styles. Every visual rule lives here.
  • @ozzyos/react: React components on React Aria Components. They add behaviour and render the class names the CSS expects.
  • apps/storybook: documentation and the test harness. Never published to npm.

Keeping it in one repo means a token change, the CSS that uses it and the stories that show it go through review in the same pull request.

Turborepo: building in the right order

The packages depend on each other, so the order matters. Turborepo reads those dependencies and runs one pnpm build in sequence: tokens first, then CSS, then React, then Storybook. It caches each step, so a change to a story doesn't rebuild the tokens.

Style Dictionary and the contrast gate

Style Dictionary turns the token JSON into the files the other packages use. Straight after, a script checks every text and background pair in every brand and mode against WCAG AA (4.5:1 for text, 3:1 for interface parts). If a pair fails, the build fails. A new client brand can't ship with unreadable colours, because it can't build.

Storybook: the workbench and the docs

Storybook is where I build and check components on their own, outside any app. A toolbar switches brand and light or dark mode, the same way a real site does with two attributes on the page.

It also does testing. The accessibility addon runs axe on every story, set to treat any violation as an error. The Vitest addon runs every story as a test in a real Chromium browser through Playwright, so colour contrast and keyboard behaviour are checked as they'd render, not in a simulated page.

GitHub Actions: the checks on every change

Every pull request and every push to main runs the CI workflow:

  1. Lint. ESLint with the strict jsx-a11y rules, and Stylelint with a rule that blocks removing focus outlines.
  2. Build. The whole chain above, including the contrast gate.
  3. Typecheck. Types require an accessible name, so an icon-only button without a label doesn't compile.
  4. Test. Unit and keyboard tests, and axe on every story.

If any step fails, the pull request can't merge. A newer push to the same branch cancels the run already in progress.

Chromatic: the published Storybook and visual review

Chromatic does two jobs. It publishes each build of Storybook, so there's a shareable version for every pull request and the current one from main serves as the public documentation. And it takes a snapshot of every story and compares it with the last approved one, so an unintended visual change shows up as a diff to approve or reject.

The free plan allows 5,000 snapshots a month, so the workflow is set up to spend them carefully:

  • It runs only when tokens, packages or stories change, not for edits to docs or config.
  • TurboSnap snapshots only the stories affected by the change.
  • By default, stories are captured in the house brand, light and dark. A component can opt in to the full matrix of every brand and mode.
  • Changes merged to main are accepted automatically as the new baseline.

Changesets and npm: releasing

Versioning is handled by Changesets. When a pull request changes a package, it includes a short changeset file saying what changed and whether it's a patch, minor or major release.

When that merges, the release workflow collects the changesets into a version pull request with updated version numbers and changelogs. Merging the version pull request publishes the packages to npm.

Publishing uses npm trusted publishing: GitHub proves to npm which workflow is publishing, so there's no npm token stored in the repo to leak. Each package also gets a provenance statement linking it to the exact commit and build that produced it. The only secret in the repository is the Chromatic project token.

Once published, jsDelivr serves @ozzyos/css from npm as a CDN file, so a site that doesn't use React can link one stylesheet and still get the tokens and styles.

Figma: planned

The plan is a private Figma plugin that syncs Figma variables with the token JSON in both directions: export from Figma into a pull request, or import the JSON into Figma. That keeps one source of truth without paying for a third-party sync tool. It isn't built yet.

What blocks what

Checks, when they run, and what they block
CheckRuns onBlocks
WCAG contrast gate on every brand and modeEvery buildThe build
ESLint (jsx-a11y, strict) and Stylelint focus guardEvery pull requestMerge
Typecheck, unit and keyboard tests, axe on every storyEvery pull requestMerge
Chromatic visual diffsPull requests that touch tokens, packages or storiesUI review approval
Manual screen reader checklistNew or changed componentRelease

Automated tools catch around a third of accessibility issues, so the last gate is manual: a screen reader pass with VoiceOver and NVDA before a new or changed component is released.

Cost

Nothing beyond a Figma Professional plan. GitHub Actions is free for a public repository, Chromatic's free plan covers the snapshot budget, and npm and jsDelivr are free for public packages.

Where it is now

The pipeline runs end to end: tokens for two brands in light and dark, the contrast gate, the CSS foundation, a first React component (Button) and Storybook with axe on every story. The first npm release and the Figma plugin are next.