Utilities
Spacing
Padding inside, margin outside. p-4 is 16px of padding all round; add a side for one edge: pt-2, px-6.
Padding
p-2
p-4
px-6 py-2
ps-8
<div class="flex flex-wrap items-start gap-3">
<div class="p-2">p-2</div>
<div class="p-4">p-4</div>
<div class="px-6 py-2">px-6 py-2</div>
<div class="ps-8">ps-8</div>
</div>
Margin
mb-4
mx-auto centers
<div class="bg-1 rounded-lg p-2">
<div class="mb-4">mb-4</div>
<div class="mx-auto w-48">mx-auto centers</div>
</div>
Orders
12
<div class="flex items-center gap-2 p-3 bg-surface rounded-lg">
<span class="font-semibold">Orders</span>
<span class="badge badge-count">12</span>
<button class="btn btn-sm ms-auto">View all</button>
</div>
ms-auto pushes the button to the end of the row — the most useful margin there is.
Space between
A stack of things without a flex container: space-y-* puts that much space between the children (not after the last one).
First
Second
Third
<div class="space-y-3"><div>First</div><div>Second</div><div>Third</div></div>
One side at a time
ms-8
me-8
mx-12
<div class="bg-1 rounded p-2 space-y-2">
<div class="ms-8">ms-8</div>
<div class="me-8">me-8</div>
<div class="mx-12">mx-12</div>
</div>
Push to the bottom: mt-auto
In a column, mt-auto pushes the last thing to the bottom — card footers that line up even when the text above is different lengths.
StarterFor one shop.
ProFor growing teams, with reports and roles.
<div class="grid grid-cols-2 gap-3">
<div class="flex flex-col bg-1 rounded-lg p-3 h-40">
<b>Starter</b>
<span class="text-sm text-muted">For one shop.</span>
<button class="btn btn-sm mt-auto">Choose</button>
</div>
<div class="flex flex-col bg-1 rounded-lg p-3 h-40">
<b>Pro</b>
<span class="text-sm text-muted">For growing teams, with reports and roles.</span>
<button class="btn btn-sm btn-default btn-solid mt-auto">Choose</button>
</div>
</div>
Space across
FirstSecondThird
<div class="space-x-3">
<span class="inline-block">First</span>
<span class="inline-block">Second</span>
<span class="inline-block">Third</span>
</div>
| Class | Side |
|---|---|
p-{n} · m-{n} | all sides |
px- · mx- | start and end (left and right) |
py- · my- | top and bottom |
pt- · pb- · mt- · mb- | top · bottom |
ps- · pe- · ms- · me- | start · end (left · right in English, flipped in right-to-left) |
m-auto · mx-auto · ms-auto · me-auto · mt-auto · mb-auto | auto margins |
space-y-{n} · space-x-{n} | between children |
| Numbers | the spacing scale: 0 · 0.5 · 1 · 1.5 · 2 · 2.5 · 3 · 4 · 5 · 6 · 8 · 10 · 12 · 16 · 20 · 24 (× 4px) — with breakpoints: p-4 md:p-8 |