Skip to content

Layout — Spacing

One scale drives gap (see Flex), every padding token, and every margin token — so a md gap and a md padding are always the same size.

xs
sm
md
lg
xl
<div and-layout="p:md">Padded on all sides</div>
TokenValueTokenValue
none0lg1.5rem
xxxs0.125remxl2rem
xxs0.25remxxl3rem
xs0.5remxxxl4rem
sm0.75remautoauto
md1rem

auto only applies to margin — it’s what makes the margin utilities double as a centering tool: m-x:auto on a width-constrained block centers it horizontally (see Recipes → Center a block).

TokenDirection
p, mAll four sides
p-t, p-b, p-l, p-rTop / bottom / left / right (padding)
m-t, m-b, m-l, m-rTop / bottom / left / right (margin)
p-x, m-xLeft + right
p-y, m-yTop + bottom

Example combining several: and-layout="p:lg m-x:auto gap-x:md".

Every token above accepts a @breakpoint suffix — see Overview → Responsive for the breakpoint table:

<!-- padding grows with viewport -->
<div and-layout="p:sm p@md:lg"></div>

Recipes → Center a block