Layout & Spacing
Everything sits on a 4px base unit. Sections are composed from three pieces: a container width, a vertical padding rhythm, and the grid inside.
Spacing scale
spacing.scale from tokens.ts — one bar per step. Use p-*, m-*, gap-* utilities with these numbers; arbitrary px values get flagged by the ESLint rule.
0 0
1 0.25rem
2 0.5rem
3 0.75rem
4 1rem
5 1.25rem
6 1.5rem
8 2rem
10 2.5rem
12 3rem
16 4rem
20 5rem
24 6rem
32 8rem
0.5 0.125rem
1.5 0.375rem
Containers
Page width is chosen per section — sm for reading, base for most content, lg for wide dashboards like this page.
section-container-sm · max-w-5xl
section-container · max-w-7xl
section-container-lg · max-w-[90rem]
| Shortcut | Max width |
|---|---|
| section-container-sm | max-w-5xl |
| section-container | max-w-7xl |
| section-container-lg | max-w-[90rem] |
| Shortcut | Padding |
|---|---|
| section-padding-sm | py-12 md:py-16 lg:py-20 |
| section-padding | py-16 md:py-24 lg:py-32 |
Breakpoints
Mobile-first — base styles target mobile, md:/lg: scale up.
| Prefix | Min width |
|---|---|
| sm | 640px |
| md | 768px |
| lg | 1024px |
| xl | 1280px |
| 2xl | 1536px |
rounded-none
rounded-sm
rounded
rounded-md
rounded-lg
rounded-xl
rounded-2xl
rounded-3xl
rounded-full
Cards use rounded-2xl,
buttons rounded-full,
inputs rounded-xl.
| Shortcut | Expands to |
|---|---|
| flex-center | flex items-center justify-center |
| flex-between | flex items-center justify-between |
| flex-start | flex items-center justify-start |
| flex-end | flex items-center justify-end |
| flex-col-center | flex flex-col items-center justify-center |
| grid-center | grid place-items-center |
| absolute-center | absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 |
Logical-property rules
| Rule | Property |
|---|---|
| mi-{n} / mie-{n} / mis-{n} | margin-inline / -end / -start (px→rem) |
| mblock-{n} / mbs-{n} / mbe-{n} | margin-block / -start / -end |
| pi-{n} / pis-{n} / pie-{n} | padding-inline / -start / -end |
| pblock-{n} / pbs-{n} / pbe-{n} | padding-block / -start / -end |
| square-{n} | width + height together (px→rem) |