Skip to main content

Spacing token reference

Every spacing and corner-radius token, with its CSS custom property and its resolved value in all three densities.

Version: 3.0.0-beta

A complete list. If you are choosing a step rather than looking one up, start with Using spacing. This page is for checking a name or a value.

Generated page

These tables are generated from the token source. If a value here disagrees with what you see in Figma or in the browser, the page is stale, so please say so rather than working around it.

21 tokens. Each one has three values, one per density. The Token column is the name you pick in Figma and the CSS custom property column is the same token in code. Both come from the token definition itself, so they cannot drift apart. The Comfortable column is what you get with no data-density attribute set.

Spacing​

17 steps, applied to padding, gap and margin.

TokenCSS custom propertyCompactComfortableRelaxed
spacing.none--eds-spacing-none0px0px0px
spacing.4xs--eds-spacing-4xs1px2px4px
spacing.3xs--eds-spacing-3xs2px4px6px
spacing.2xs--eds-spacing-2xs4px6px8px
spacing.xs--eds-spacing-xs6px8px10px
spacing.sm--eds-spacing-sm10px12px16px
spacing.md--eds-spacing-md12px16px20px
spacing.lg--eds-spacing-lg16px20px24px
spacing.xl--eds-spacing-xl20px24px28px
spacing.2xl--eds-spacing-2xl24px28px32px
spacing.3xl--eds-spacing-3xl28px32px36px
spacing.4xl--eds-spacing-4xl36px40px44px
spacing.5xl--eds-spacing-5xl44px48px52px
spacing.6xl--eds-spacing-6xl60px64px72px
spacing.7xl--eds-spacing-7xl72px80px88px
spacing.8xl--eds-spacing-8xl88px96px112px
spacing.9xl--eds-spacing-9xl112px128px144px

Corner radius​

4 tokens, in the same density collection as spacing.

TokenCSS custom propertyCompactComfortableRelaxed
corner-radius.none--eds-corner-radius-none0px0px0px
corner-radius.rounded--eds-corner-radius-rounded2px4px6px
corner-radius.rounded-outer--eds-corner-radius-rounded-outer3px5px7px
corner-radius.pill--eds-corner-radius-pill9999px9999px9999px

In TypeScript​

The tokens also ship as TypeScript objects, for the places a CSS custom property cannot reach. Spacing has one wrinkle the colour tokens do not: a name segment starting with a digit becomes a word, so spacing.2xl is spacing.twoXl and corner-radius.rounded-outer is cornerRadius.roundedOuter.

import { semantic } from '@equinor/eds-tokens/next/ts/semantic/light.ts'

semantic.spacing.md // 16
semantic.spacing.twoXl // 28
semantic.cornerRadius.roundedOuter // 5

Three differences from the CSS form, all easy to miss:

  • The specifier carries the file extension. ./next/* is a wildcard onto the source tree, so next/ts/semantic/light does not resolve and next/ts/semantic/light.ts does. The next/ paths are temporary for the beta line.
  • The values are unitless numbers, not lengths. 16, not 16px. Add the unit yourself.
  • semantic is frozen at Comfortable. There is no attribute for an object to read, so the densities are separate modules and you pick one:
import { density } from '@equinor/eds-tokens/next/ts/density/compact.ts'

density.spacing.md // 12

So prefer the CSS custom properties wherever they work. Use the TypeScript objects only where they do not, and expect to handle density yourself when you do.