Skip to content

Design tokens: a semantic layer the page can speak (stack 2 of 6) - #384

Merged
danbaruka merged 2 commits into
IntersectMBO:mainfrom
IanoNjuguna:stack/02-tokens
Nov 7, 2026
Merged

danbaruka merged 2 commits into
IntersectMBO:mainfrom
IanoNjuguna:stack/02-tokens

Conversation

@IanoNjuguna

Copy link
Copy Markdown
Contributor

What this does

One file, 108 lines: a semantic token layer, and nothing that uses it yet.

Colour, spacing, radius and shadow tokens named by intent rather than by value; the warning callout's four values; the five track accents with their dark variants; the focus ring; the rules that let a theme switch cross-fade instead of interpolating each element. 106 tokens where the stylesheet had 85, and it drops none of them, so every existing rule resolves to exactly what it resolved to before.

The dark surface moves to html[data-theme='dark'] in the same pass. Infima declares its own dark tokens on that selector, so a bare [data-theme='dark'] block loses every contested token without saying so: that is what made the first attempt at dark mode look half-applied.

Why this is its own PR

It is the vocabulary the next PR speaks. Shipping it alone means the colour, spacing and contrast decisions get read as one page of values rather than buried in 2,500 lines of page work, and it cannot break anything: nothing references the new names yet.

Verified

  • npx docusaurus build succeeds
  • Rendered page unchanged: bar rgb(37,85,254), links rgb(35,83,255), the home page still the old hero and cards, footer still its gradient
  • --color-accent-blazing resolves to #ff4b11, so the new names are live in the cascade

Three things that no page renders yet, shipped first so the landing page can import them.

`scripts/generate-sessions.js` reads the archive's frontmatter and writes
`src/data/sessions.json`. It derives each href from the file's own path, accounting for
Docusaurus stripping number prefixes and for `readme`/`index` folders, because the archive is
inconsistent: most sessions carry a `slug:` that includes their number, eight have none and are
served at the number-stripped path, and two folders are both numbered 14. 21 sessions against
26 built routes, none missing.

`scripts/fetch-github-data.js` also calls `/repos/{owner}/{repo}` and writes a `repo` block,
with the same keep-on-failure rule as the rest of that script. `githubData.json` gains that
block so a local build has stars and forks to render.

`@types/react-dom` arrives for the components that follow.
Colour, spacing, radius and shadow tokens named by intent rather than by value, plus the
warning callout's four values, the track accents, the focus ring and the theme-switch rules.
106 tokens where the stylesheet had 85 and drops none of them, so every existing rule keeps
resolving to what it resolved to before: the rendered page is unchanged, which is the point of
landing the vocabulary before the page that speaks it.

The dark surface moves to html[data-theme='dark'] in the same pass. Infima declares its own dark
tokens on that selector, so a bare [data-theme='dark'] block loses every contested token without
saying so.
@danbaruka
danbaruka merged commit d168db5 into IntersectMBO:main Nov 7, 2026
3 checks passed
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