Field Notes
Constraints

Dos and Don'ts

Practical rules for using tokens correctly in components and layouts.

Token Usage

/* DO — use semantic tokens in components */
.card { background: var(--background-neutral-weaker-rest); }

/* DON'T — hardcode primitives in components */
.card { background: var(--colors-neutral-100); }

/* DO — reference primitives when defining semantics */
--background-neutral-weaker-rest: var(--colors-neutral-100);

/* DON'T — use raw values anywhere */
.card { background: #f5f5f5; }

Foreground / Background Pairing

/* DO — matched family and emphasis */
.card {
  background: var(--background-neutral-weaker-rest);
  color: var(--foreground-neutral-rest);
}

/* DON'T — mismatched families */
.card {
  background: var(--background-brand-rest);
  color: var(--foreground-neutral-strong-rest);
}

Composition

DoDon't
Assign sentiment based on content intentChoose sentiment for aesthetic reasons
Match emphasis to actual urgencyReduce emphasis to make things "look nicer"
Use declared sentiments onlyInvent new sentiment values
Let state be runtime-determinedSet state via static props
Use size for footprint and spacing changesInvent per-component density overrides

Spacing

DoDon't
Use tight spacing for related elementsSpace everything equally
Use loose spacing between categoriesUse tight spacing for unrelated items
Follow the spacing tier guideGuess pixel values

File Management

DoDon't
Edit *-extended.css for manual tokensEdit dist/tokens.css
Import primitives before semanticsImport in random order
Use var() references in semantic definitionsCopy raw values into semantics

On this page