Contributing
Tokens live as DTCG JSON in shared/design/tokens/json/. Terrazzo builds them into CSS, and a small script adds the Tailwind theme, the text-style utilities, the TypeScript module and the pages on this site. A change takes three steps and ends in a pull request.
1. Edit the token files
Section titled “1. Edit the token files”Each collection has one file with its default mode: primitives, semantic (light), direction (standard), dimension and layout (mobile). The other modes sit in modes/: theme-dark, direction-color-blind and layout-tablet, layout-desktop and layout-wide. Text styles are in typography and shadows in effects.
A token’s CSS name lives in $extensions["finance.umia"].css. Point to another token with an alias like {primitives.color.green.500} instead of copying its value.
2. Regenerate
Section titled “2. Regenerate”just design-buildThis runs Terrazzo, then rewrites styles.css, the TypeScript module and the Markdown in shared/design/docs/foundations/. This site copies those files when it builds.
3. Review and open a pull request
Section titled “3. Review and open a pull request”Read the diff of the token files and the generated files, and check the screens in the hub that use the changed tokens. Run bun --filter @umia/design test, then open a pull request. Don’t edit generated files by hand.
Writing a component page
Section titled “Writing a component page”Each component has one page at src/content/docs/components/<name>.mdx, with its previews in src/components/previews/<name>.tsx. The previews import the real component from web/hub/components/ui, so the page always matches what ships.
Keep the sections in this order, which follows Carbon and Primer:
- One sentence on what the component is for, then
ComponentMetawith its status, source file and Figma node. - A playground with the main props as controls and code you can copy.
- When to use it and when not to. Every “when not to” names what to use instead.
- An anatomy diagram on a live example, with numbered parts. Mark the optional ones.
- One example row each for variants, sizes, icons and states, then how to choose between them.
- Rules for writing the label, with at least one
DoDontpair. - How it behaves with a keyboard and a pointer.
- What it needs to be accessible, such as labels, focus, ARIA and contrast.
- Every prop with its type, default and a short note. Props that aren’t listed pass through to the HTML element.
- Related components, and when each one fits better.
Show rules as DoDont pairs where you can. Seeing the wrong version teaches faster than reading about it.
Only previews that need JavaScript get client:load, which means the playground and the anatomy. Every other example is plain HTML, so leave the directive off.
Editing these guides
Section titled “Editing these guides”The guides live in web/design/src/content/docs/. Keep each one short. The Foundations pages are generated, so fix their wording at the source in shared/design.