Skip to main content

Design tokens

Design tokens are the named values behind every EDS component: colour, spacing, typography, corner radius and elevation. Designers and developers use the same names, in Figma and in code.

Version: EDS 2.0 (beta)

How tokens work​

A design token is a named value, such as spacing.md or background.surface. Components and layouts refer to the name instead of a fixed value, so the value can change without anyone having to find and replace it.

In Figma, the tokens are variables in the EDS libraries. In code, they are CSS custom properties from the @equinor/eds-tokens package. The CSS name is the token name in kebab case with an --eds- prefix, so spacing.md becomes --eds-spacing-md.

Modes​

Some tokens have a different value in each mode, while the name stays the same:

ModeValuesSet in code withChanges
Colour schemeLight, Darkdata-color-scheme="light" or data-color-scheme="dark"Colour
DensityCompact, Comfortable, Relaxeddata-density="compact" or data-density="relaxed"; Comfortable is the defaultSpacing, typography and corner radius

Set the attribute on a container, and everything inside it follows. In Figma, set the same modes on the frame.

Token groups​

GroupWhat it covers
ColourBackgrounds, text, borders, icons and data visualisation, in light and dark
SpacingPadding and gaps, inside and between components
TypographyFont families, sizes, line heights and weights
Corner radiusRounded corners, which follow the density like spacing does
ElevationShadows for UI that floats above the page