Tokens

Tokens are the sizes and fonts shared by every theme. They live in tokens.css. Colors are not here: they belong to the themes.

Pixel

--pix-pixel is one logical pixel. Every other size is a whole multiple of it, which keeps everything on the same grid.

VariableValue
--pix-pixel4px

Change it to scale the whole system at once.

:root {
  --pix-pixel: 3px;
}

For a size that has no token, multiply the pixel instead of writing a fixed number.

.avatar {
  width: calc(var(--pix-pixel) * 16);
  height: calc(var(--pix-pixel) * 16);
}

Spacing

Use for padding, margin and gap.

VariableValueSize
--pix-space-1calc(var(--pix-pixel) * 1)
--pix-space-2calc(var(--pix-pixel) * 2)
--pix-space-3calc(var(--pix-pixel) * 3)
--pix-space-4calc(var(--pix-pixel) * 4)
--pix-space-5calc(var(--pix-pixel) * 6)
--pix-space-6calc(var(--pix-pixel) * 8)

Font families

The display font is for headings only. It is too wide for running text.

VariableValueSample
--pix-font-display'Press Start 2P', monospacePixel 0123
--pix-font-body'VT323', monospacePixel 0123

Font sizes

heading and title are meant for the display font,small and body for the body font.

VariableValue
--pix-font-size-small20px
--pix-font-size-body24px
--pix-font-size-heading16px
--pix-font-size-title24px

Border

VariableValue
--pix-border-widthvar(--pix-pixel)