Design tokens are the CSS custom properties behind our color, spacing, type, and more. Reach for a token instead of a hand-picked value.
Design tokens are named CSS custom properties that hold the values behind our look and feel: color, spacing, type, and more. Reach for a token instead of a hand-picked value so your work stays consistent with the system and updates with it.
Use a token anywhere you would write a raw value:
.card {
padding: var(--pl-space-l);
border-radius: var(--pl-border-radius);
color: var(--pl-color-fg-default);
}
Color tokens come in two layers: a raw palette and the semantic roles built on top of it. Reach for the roles, like --pl-color-fg-default and --pl-color-bg-accent, rather than naming a specific color.
See Color for the full palette, the foreground and background roles, and contrast guidance.
Use spacing tokens for margin, padding, and gap so the rhythm of your layout matches the rest of the system. For the utility classes built on these tokens, see CSS utilities.
--pl-space-3xs--pl-space-2xs--pl-space-xs--pl-space-s--pl-space-m--pl-space-l--pl-space-xl--pl-space-2xl--pl-space-3xlSet type from our scale so sizes stay consistent across spaces. To style a whole region's type at once, see Typeset.
--pl-font-size-xs--pl-font-size-s--pl-font-size-m--pl-font-size-l--pl-font-size-xl--pl-font-size-2xl--pl-font-size-3xl--pl-font-size-4xl--pl-font-size-5xlThe base font size is set on the root:
--pl-font-size--pl-font-sans-serif--pl-font-serif--pl-font-family--pl-font-sans-serif.These tokens style the underline on links so it stays consistent and legible.
--pl-link-text-underline-offset--pl-link-text-decoration-thickness--pl-link-hover-text-decoration-thicknessRound corners with a token so boxes, cards, and images share the same shape. For the utility classes, see CSS utilities.
--pl-border-radius--pl-border-radius-subtleApply this token to a custom component's :focus-visible state so its focus ring matches everything else in the system.
--pl-focus-box-shadowThese tokens control the width and gutters of the centered page frame applied by .pl-viewport-margins. The gutter widens on larger screens.
--pl-viewport-margins-max-width--pl-viewport-margins-gutter