Spacing

Spacing utilities use the pixel value in the class name: p-16 is 16px of padding (1rem), mt-32 is 32px of top margin. The scale is built on a 4px base unit. Use these system steps for gaps, padding and margins so layouts stay on the same rhythm.

Spacing scale

2 0.125rem
4 0.25rem
8 0.5rem
12 0.75rem
16 1rem
24 1.5rem
32 2rem
40 2.5rem
48 3rem
64 4rem
96 6rem
128 8rem
160 10rem
196 12.25rem
UtilityExampleResult
p-{n}, px-{n}, py-{n}, pt-{n}…p-2424px padding
m-{n}, mx-{n}, my-{n}, mt-{n}…mt-3232px top margin
gap-{n}, gap-x-{n}, gap-y-{n}gap-1616px gap in flex and grid layouts
space-x-{n}, space-y-{n}space-y-88px between stacked children

Beyond the scale, a few arbitrary values exist for layout edge cases: 6, 30, 128, 160, 196, center-xxxl.

Padding examples

The hatched area is the padding.

p-88px
p-1616px
p-2424px
p-3232px
p-4848px

Section spacing

Vertical rhythm between page sections uses spacing groups that grow on large screens:

GroupCSS variableSmall screensLarge screens
space-01--spacing-space-0180px120px
space-02--spacing-space-0260px80px
space-03--spacing-space-03100px120px
space-04--spacing-space-0428px28px