Meet Frontfriend v4.Your brand. Your rules. Your agents, connected.Explore what’s new
DocumentationDesign tokens

Design tokens

Name intent once. Carry it through your whole interface.

Read as Markdown

Tokens express the role of a design value. bg-brand-mid communicates brand emphasis; text-neutral-strong communicates readable primary text. Frontfriend generates semantic Tailwind utilities from your Design System.

The vocabulary

The general form is {utility}-{family}-{step}[-{state}]. Common utilities include bg-, text-, border-, ring-, outline-, fill- and stroke-.

FamilyPurposeExample
brandBrand emphasisbg-brand-mid
neutralGeneral interface contenttext-neutral-strong
interactiveInteractive surfacesbg-interactive-mid
positiveSuccessful outcomestext-positive-strong
negativeErrors and destructive actionsbg-negative-mid
warningAttention and cautiontext-warning-strong
infoInformational contenttext-info-strong
highlightHighlighted contentbg-highlight-subtle
inverseInverse contrastbg-inverse-mid

Foreground families such as onbrand pair with their background intent. Available steps and states come from the system; do not assume every combination exists.

Layers and states

<section className="bg-layer-raised text-neutral-strong border border-neutral-subtle rounded-lg p-6">
  <h2 className="text-lg font-semibold">A shared foundation</h2>
  <p className="text-neutral-mid">A change with a clear purpose.</p>
</section>

Surface examples include layer-below, layer-surface, layer-raised, layer-control, layer-popover and layer-dialog. Use bg-overlay for an overlay. Hover and active states can be explicit tokens, such as bg-brand-mid-hover; disabled controls use dedicated disabled tokens.

Spacing, radius and typography scale remain normal Tailwind utilities. Color families, surfaces, font families and animations use the generated vocabulary.

shadcn compatibility

shadcn roleFrontfriend role
primarybrand-mid
primary-foregroundonbrand-mid
backgroundlayer-below
foregroundneutral-strong
muted-foregroundneutral-mid
destructivenegative-mid
borderneutral-subtle

Compatibility variables preserve shadcn roles while your canonical vocabulary becomes semantic. Do not mechanically replace every string without understanding its role.

Generated files

The build plugin resolves @frontfriend/tailwind/theme.css to generated cache assets. Configuration-driven classes are included for Tailwind scanning. Avoid editing generated cache files; update the Design System and regenerate.

When available, .frontfriend/foundation.md is the authoritative vocabulary for your specific system. See Agent context and Dark mode.