Maintenance
How to change, build, and check this reference, and where the design decisions are recorded.
Updating tokens
- Edit colour, spacing, radius, shadow, and type in Figma, then run
npm run build:design. Font families are the exception: editstyles/typography/fontFamilies.cssby hand. - Edit motion in
js/choreography/tokens/motion/motion.js, then runnpm run build:motion. - Never edit
styles/colors.css,styles/tokens.css, orstyles/motion.cssby hand. The next sync overwrites them. - The Tokens page has the table of where each group comes from and how to change it.
Adding a component page
- A component page is a Markdown file at
ia/docs/design/<path under views/>.md, with frontmatter naming thecomponentand listingspecimens. The contract is inviews/templates/design-doc/design-doc.md. - Give a new component a page when you add it.
npm run scaffold:componentgenerates the component. - Add the page to its group in
GROUPSinia/docs/design/design.11tydata.js. A page the table doesn't list still renders, under "Ungrouped".
Adding a choreography module
- Edit the sidecar, not a page here. A new module needs only its sidecar: the next build gives it a page and a sidebar entry.
- The contract is in
ia/docs/design/choreography/choreography.11tydata.md.
Building and previewing
npm run documentbuilds the site with/docs/.npm run start:docsserves it, and watchesdocs.cssand the choreography sidecars.npm startandnpm run quickskip/docs/.- Markdown headings on these pages get an
idat build time, so a section can be linked. The id is the heading text, lower-cased and hyphenated (Adding a component pagebecomes#adding-a-component-page), with-2,-3on a repeat. A heading that already has anidkeeps it. Headings written in HTML, in the layout or in a specimen, are not touched.
Checks
npm testruns the logger, choreography, and Figma token tests.npm run validateruns every check: formatting, frontmatter, palette, motion tokens, sidecars, and the tests.npm run check:motionfails whenstyles/motion.csshas drifted frommotion.js.
Decisions
The decision records are in specs/decisions/:
adr-0001-figma-owns-design-tokens.mdadr-0002-figma-library-variables-are-the-design-tokens.mdadr-0003-figma-owns-mapped-component-colours.mdadr-0004-gsap-runs-motion-eases-as-mapped-core-eases.md