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.125rem4
0.25rem8
0.5rem12
0.75rem16
1rem24
1.5rem32
2rem40
2.5rem48
3rem64
4rem96
6rem128
8rem160
10rem196
12.25rem| Utility | Example | Result |
|---|---|---|
p-{n}, px-{n}, py-{n}, pt-{n}… | p-24 | 24px padding |
m-{n}, mx-{n}, my-{n}, mt-{n}… | mt-32 | 32px top margin |
gap-{n}, gap-x-{n}, gap-y-{n} | gap-16 | 16px gap in flex and grid layouts |
space-x-{n}, space-y-{n} | space-y-8 | 8px 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-88pxp-1616pxp-2424pxp-3232pxp-4848pxSection spacing
Vertical rhythm between page sections uses spacing groups that grow on large screens:
| Group | CSS variable | Small screens | Large screens | |
|---|---|---|---|---|
space-01 | --spacing-space-01 | 80px | 120px | |
space-02 | --spacing-space-02 | 60px | 80px | |
space-03 | --spacing-space-03 | 100px | 120px | |
space-04 | --spacing-space-04 | 28px | 28px |