Skip to content

Type & Spacing Scales

When you nudge an element in Figma, the default nudge is 8px. That is not an accident. The 8px grid is the most common spacing system in professional design — and it has a direct code equivalent that keeps your layouts consistent.

A spacing scale is a fixed set of values built on a base unit. The most common base is 4px (with 8px as the “standard step”). Here is how it maps:

Token nameValueFigma equivalent
--space-14pxNudge × 0.5
--space-28px1 nudge
--space-312px1.5 nudges
--space-416px2 nudges
--space-624px3 nudges
--space-832px4 nudges
--space-1248px6 nudges
--space-1664px8 nudges

Everything in your layout — padding, margin, gap between elements — should use one of these values. Values that are “off-scale” (like 13px or 22px) are usually design mistakes worth correcting.

A type scale is a consistent set of font sizes built on a ratio. Common ratios are 1.25 (Major Third) and 1.5 (Perfect Fifth). Starting from a base of 16px:

Token nameValue (ratio 1.25)Use
--text-xs12pxLabels, captions
--text-sm14pxSecondary body, metadata
--text-base16pxBody text
--text-lg20pxLead text, card headings
--text-xl24pxSection headings
--text-2xl32pxPage headings
--text-3xl40pxHero headlines

In Figma, these map to your Text Styles. If your text styles are named body/sm, body/base, heading/lg, they should translate directly to --text-sm, --text-base, --text-lg.

The section below uses only token-based spacing and type sizes. Change --text-base or --space-4 in the CSS and watch the scale ripple through.

Why do designers often use 8px as a base spacing unit?
A type scale defines...
Which CSS property would you use a spacing token for?