Tools / UI/UX Design
Generate a consistent spacing token scale from a base unit and preset (linear, compact, comfortable) or custom multipliers. Export CSS custom properties and a Tailwind-friendly snippet, with a live preview of padding, gaps, and button spacing.
Inputs
px
px
Letters, numbers, hyphens: e.g. space → --space-0
Live UI previewPadding, gaps, and button spacing update from your scale.
Sample cardPadding, gaps, and button spacing update from your scale.
ChipChip
Primary actionGenerated spacing tokens
| Token | × | px | rem | Preview |
|---|---|---|---|---|
--space-0 | 0 | 0 | 0 | |
--space-1 | 1 | 4 | 0.25 | |
--space-2 | 2 | 8 | 0.5 | |
--space-3 | 3 | 12 | 0.75 | |
--space-4 | 4 | 16 | 1 | |
--space-5 | 5 | 20 | 1.25 | |
--space-6 | 6 | 24 | 1.5 | |
--space-7 | 8 | 32 | 2 | |
--space-8 | 10 | 40 | 2.5 | |
--space-9 | 12 | 48 | 3 | |
--space-10 | 16 | 64 | 4 |
CSS custom properties
:root {
/* Generated spacing scale, rem assumes 16px root font size */
--space-0: 0px; /* 0rem · ×0 */
--space-1: 4px; /* 0.25rem · ×1 */
--space-2: 8px; /* 0.5rem · ×2 */
--space-3: 12px; /* 0.75rem · ×3 */
--space-4: 16px; /* 1rem · ×4 */
--space-5: 20px; /* 1.25rem · ×5 */
--space-6: 24px; /* 1.5rem · ×6 */
--space-7: 32px; /* 2rem · ×8 */
--space-8: 40px; /* 2.5rem · ×10 */
--space-9: 48px; /* 3rem · ×12 */
--space-10: 64px; /* 4rem · ×16 */
}Tailwind-friendly snippet
// Tailwind theme.extend.spacing (values in rem; root = 16px)
spacing: {
"0": "0rem",
"1": "0.25rem",
"2": "0.5rem",
"3": "0.75rem",
"4": "1rem",
"5": "1.25rem",
"6": "1.5rem",
"7": "2rem",
"8": "2.5rem",
"9": "3rem",
"10": "4rem",
}- 01Token px = base spacing unit × multiplier.
- 02Token rem = token px ÷ assumed root font size (default 16px).
- 03CSS custom properties use a sanitized prefix (e.g. --space-3).
- 04Presets supply multiplier lists; custom mode uses the multipliers you enter.
Worked example. Base 4px, root 16px, linear multipliers. Token ×3 → 12px → 0.75rem. CSS: --space-3: 12px.
AuditUI/UX Audit
Your numbers show a leak. An audit shows the screen.
$19.99$149.99
Get the audit
