- Read the Redoc theme colours out of the cascade instead of duplicating
ten token values as literals, so tokens.css stays the single source
- Guard the color-mix rail background with @supports, and give both chrome
surfaces an on-primary base colour so a failed mix stays legible
- Drop shape.borderRadius: Redoc v2.4.0 has no such theme key, so it was
never read. Style its submit buttons via CSS instead
- Stop targeting Redoc's generated .menu-content class
- Source every cream value from --si-color-neutral-off-white, and let the
logo inherit via currentColor
- Use --si-color-on-primary for text on primary blue, not text-inverse
- Leave the root font-size to the browser
- Keep the repo link visible on mobile and stop hiding a header link by
document position
- Drop role="img" from the aria-hidden logo
- Stage all of docs/ in the deploy workflow rather than named files
- Add a CI check that every --si-* token the page references is defined
- Record the tokens.css provenance in the README
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014NpGbnum1AQPfQMvLSDa1D
User description
The published API reference now takes its colours, type and spacing from the Smile ID design system's token layer instead of a set of hand-picked hex values. The rendering is the same shape as before — a spec switcher next to a Redoc pane — it just follows the brand.
Changes
docs/tokens.cssis a verbatim copy of the design system's generateddist/css/tokens.css. The page consumesvar(--si-*)throughout, and the Redoc theme reads the same values out of the cascade at runtime, so there is one source of truth rather than two.docs/rather than named files, so the next asset needs no workflow change.--si-*tokendocs/index.htmlreferences is defined indocs/tokens.css. A rename in a future refresh fails the build instead of silently unstyling the page.The second commit applies the findings from a four-pass review: dropping a
shape.borderRadiustheme key that Redoc v2.4.0 never reads, guarding thecolor-mixrail background with@supportsso an unsupported browser cannot leave the switcher invisible, and removing a selector that targeted one of Redoc's generated class names.How to test
Serve the repo root and open
docs/index.html, or check the Pages deployment once merged.Worth a look: the spec switcher at desktop and at 420px wide, the code sample panel on the right, and the browser console (should be clean).
docs/tokens.cssis generated — review the two lines that reference it, not its contents.🤖 Generated with Claude Code
https://claude.ai/code/session_014NpGbnum1AQPfQMvLSDa1D
PR Type
Enhancement, Documentation
Description
Restyle API reference using Smile ID design tokens
Vendor
docs/tokens.cssas single source of truthRead Redoc theme colours from CSS cascade
Add CI token check, favicon, and mobile chip nav
Diagram Walkthrough
File Walkthrough
tokens.css
Add vendored Smile ID design tokensdocs/tokens.css
--si-*colours, spacing, radii, typography, and componentsindex.html
Restyle page with design tokens and logodocs/index.html
var(--si-*)tokensvalidate.yml
Add token-definition validation check.github/workflows/validate.yml
--si-*token referenced is defineddocs/tokens.cssdeploy-docs.yml
Stage entire docs directory on deploy.github/workflows/deploy-docs.yml
docs/instead of named filesREADME.md
Document design tokens provenanceREADME.md
docs/tokens.cssis a verbatim vendored copy