Tokens

M3's design tokens as Tailwind utilities, named after the token they come from.

Color

Every M3 color role is a Tailwind color: md.sys.color.primary is bg-md-sys-color-primary, text-md-sys-color-primary, border-md-sys-color-primary and so on, with opacity modifiers (bg-md-sys-color-on-surface/8). Pair every container with its on-* role.

Type scale

The 15 M3 type styles are single classes that set font, weight, size, line height and tracking together. Use them without a prefix, and don't combine them with text-*, leading-*, tracking-* or font-*.

Class Use
md-sys-typescale-<role>-<size>Baseline style: roles display, headline, title, body, label; sizes large, medium, small
md-sys-typescale-emphasized-<role>-<size>Same metrics, heavier weight: selected, active or unread states
md-sys-typescale-label-{large,medium}-prominentThe 700-weight label tokens

Line heights follow each element's lang, per M3's language-height categories. The Typography page in Storybook has the details.

Spacing

M3's spacing tokens (md.sys.measurement.space*, on an 8dp base) are registered in Tailwind's spacing namespace, so every spacing, sizing and inset utility takes them: p-spacing-200, gap-spacing-50, size-spacing-600, -mt-spacing-100. The library itself uses only these; Tailwind's numeric scale (p-4) still works in your app.

Class suffix Token Value
spacing-0space00dp
spacing-25space252dp
spacing-50space504dp
spacing-75space756dp
spacing-100space1008dp
spacing-125space12510dp
spacing-150space15012dp
spacing-175space17514dp
spacing-200space20016dp
spacing-250space25020dp
spacing-300space30024dp
spacing-400space40032dp
spacing-450space45036dp
spacing-500space50040dp
spacing-600space60048dp
spacing-700space70056dp
spacing-800space80064dp
spacing-900space90072dp
spacing-1000library addition80dp
spacing-2400library addition192dp
spacing-3200library addition256dp
spacing-6400library addition512dp

The number is M3's, not Tailwind's multiplier: spacing-200 is 16dp, the same as p-4. Stick to one scale per codebase so the two don't get mixed up. M3 stops at space900; spacing-1000, spacing-2400, spacing-3200 and spacing-6400 are library additions that follow the same rule. Use w-spacing-3200 for a fixed search field or max-h-spacing-6400 for a 512dp scroll-list cap.

<div class="flex flex-col gap-spacing-200 p-spacing-300">…</div>

Shape

The M3 corner scale: rounded-xs (4dp), rounded-sm (8dp), rounded-md (12dp), rounded-lg (16dp), rounded-xl (28dp) and rounded-full.

Elevation

shadow-elevation-0 to shadow-elevation-5 are the M3 elevation levels, tinted from the scheme's shadow color. Use a higher level for surfaces that sit above their neighbors (menus, floating action buttons, dialogs), not as decoration.

Motion

Color and opacity changes use the spring-based transition utilities (transition-colors md-sys-motion-effects). Anything that moves or resizes runs on JS springs; see the Motion guide.