Skip to main content

Spacing

A 4 px scale and named layout distances that follow the density mode.

Primitive scale

The 4 px steps behind every spacing utility. These do not change with density.

TokenValueUtilityScale
space.00pxp-0
space.14pxp-1
space.28pxp-2
space.312pxp-3
space.416pxp-4
space.520pxp-5
space.624pxp-6
space.728pxp-7
space.832pxp-8
space.936pxp-9
space.1040pxp-10
space.1248pxp-12
space.1664pxp-16
space.2080pxp-20
space.2496pxp-24
space.px1pxp-px
space.0-52pxp-0.5
space.1-56pxp-1.5
space.2-510pxp-2.5

Semantic distances

Named distances that components and layouts use. The compact column is the value under data-density="compact".

TokenComfortableCompactUtility
layout.stack-xs4pxsamegap-stack-xs
layout.stack-sm8pxsamegap-stack-sm
layout.stack-md16px12pxgap-stack-md
layout.stack-lg24px16pxgap-stack-lg
layout.inline-sm8pxsamegap-inline-sm
layout.inline-md12pxsamegap-inline-md
layout.card-x20px12pxpx-card-x (Card padding md)
layout.card-y16px12pxpy-card-y (Card padding md)
layout.card-x-sm16px8pxpx-card-x-sm (Card padding sm)
layout.card-y-sm12px8pxpy-card-y-sm (Card padding sm)
layout.gutter

Gap between grid columns.

24px16pxgap-gutter
layout.margin

Page padding at the edge of the main area.

32px24pxpx-margin
layout.section

Space between page sections.

32px24pxpy-section · gap-section