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.
| Variable | Value |
|---|---|
--pix-pixel | 4px |
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.
| Variable | Value | Size |
|---|---|---|
--pix-space-1 | calc(var(--pix-pixel) * 1) | |
--pix-space-2 | calc(var(--pix-pixel) * 2) | |
--pix-space-3 | calc(var(--pix-pixel) * 3) | |
--pix-space-4 | calc(var(--pix-pixel) * 4) | |
--pix-space-5 | calc(var(--pix-pixel) * 6) | |
--pix-space-6 | calc(var(--pix-pixel) * 8) |
Font families
The display font is for headings only. It is too wide for running text.
| Variable | Value | Sample |
|---|---|---|
--pix-font-display | 'Press Start 2P', monospace | Pixel 0123 |
--pix-font-body | 'VT323', monospace | Pixel 0123 |
Font sizes
heading and title are meant for the display font,small and body for the body font.
| Variable | Value |
|---|---|
--pix-font-size-small | 20px |
--pix-font-size-body | 24px |
--pix-font-size-heading | 16px |
--pix-font-size-title | 24px |
Border
| Variable | Value |
|---|---|
--pix-border-width | var(--pix-pixel) |