Foundations
Spacing
4px system (Tailwind default). Every layout uses this scale. Don't invent values like 7px or 13px.
Updated Jul 8, 2026 by Leonardo Posada
Scale
Each token equals Tailwind class × 4px. gap-2 = 8px.
| Token | Pixels | Visual |
|---|---|---|
| 0 | 0px | |
| 0.5 | 2px | |
| 1 | 4px | |
| 1.5 | 6px | |
| 2 | 8px | |
| 2.5 | 10px | |
| 3 | 12px | |
| 4 | 16px | |
| 5 | 20px | |
| 6 | 24px | |
| 8 | 32px | |
| 10 | 40px | |
| 12 | 48px | |
| 16 | 64px | |
| 20 | 80px | |
| 24 | 96px |
Semantic usage
The most frequent patterns when laying out at Yuno.
| Context | Value | Note |
|---|---|---|
| Card padding | p-6 (24px) | Content cards. p-5 for denser cards. |
| Vertical section gap | py-10 (40px) | Between large sections of a doc page. |
| Form field gap | gap-1.5 (6px) | Between Label and Input inside a field. |
| Stack of fields | gap-4 (16px) | Between fields in a form. |
| Button internal gap | gap-2 (8px) | Between icon and label inside a button. |
| List row padding | px-4 py-2.5 (16 / 10px) | Menu items, list rows, table cells. |
Usage
Do
- Use multiples of 4 (2, 4, 8, 12, 16, 24…) for every measurement.
- Prefer gap-* over space-x/space-y in flex/grid.
- Container vertical padding for dashboard: py-8 or py-10.
- Page horizontal padding: px-10 on desktop.
Don't
- Don't invent custom values (7, 11, 13, 27px).
- Don't mix gap and margin in the same layout — pick one.
- Don't use magic numbers in style={{ }} — always a Tailwind class.
- Don't over-use space-y-* — gap is more predictable in grids.