Escala de Espaçamento
Two complementary spacing systems: fluid named tokens that scale with viewport for section-level spacing, and a static numeric scale for component-level gaps. Every value is a CSS custom property with a purpose-driven name.
8 tokens using clamp() for seamless scaling between mobile (375px) and desktop (1280px). The bars below show the ACTUAL computed pixel width at your current viewport. Resize the browser to see them change.
Click any row to copy the CSS variable. The first three (xs, sm, md) are static. The last five scale fluidly. Each step is roughly 1.5-2x the previous.
- Section vertical padding:
--space-3xl(standard) or--space-4xl(hero) - Major content breaks between sections
- Hero breathing room and page-level vertical rhythm
- Any spacing that should scale fluidly with viewport
11-step static scale for component-level gaps, padding, and margins. These do not scale with viewport. Based on a 4px grid with intermediate values (12px, 20px) for common UI needs.
- Grid gaps:
gap: var(--gap-4) - Card internal padding:
padding: var(--gap-6)orvar(--gap-7) - Icon-to-label gaps:
gap: var(--gap-2) - Button padding, badge spacing, form element gaps
The two scales serve different purposes. Named tokens define the page-level rhythm. Numeric tokens define the component-level rhythm. They work together but should not be mixed in the wrong context.
- -- Scales with viewport via
clamp() - -- Section padding, page-level vertical rhythm
- -- Hero breathing room, major content breaks
- -- 8 tokens: xs through 4xl
- -- Fixed pixel values, no viewport scaling
- -- Grid gaps, card padding, component spacing
- -- Icon gaps, button padding, form fields
- -- 11 tokens: gap-0 through gap-10
- Use --space-3xl for section vertical padding
- Use --gap-4 or --gap-6 for card internal padding
- Use --gap-2 for inline icon-to-text gaps
- Use --space-xl between content groups within a section
- Use --gap-10 for section padding (does not scale)
- Use --space-3xl for component grid gaps (over-scales)
- Use arbitrary values like 17px or 22px
- Mix named and numeric in the same property
Standardized vertical padding for different section types. These demos use ACTUAL token values -- the height of each box is the real computed padding at your viewport width.
--space-4xl 80-160px --space-3xl 64-120px --space-2xl 48-80px --space-3xl / --space-2xl 64-120px / 48-80px --space-4xl top / --space-3xl bottom --space-3xl top and bottom --space-2xl top and bottom --space-3xl top / --space-2xl bottom Content width hierarchy. Each container has a semantic name matching its content type. The bars below show relative proportions at your current viewport width.
--container-padding: clamp(20px, 5vw, 48px) -- fluid horizontal padding applied to all containers.
Mobile (375px): 20px. Tablet (768px): ~38px. Desktop (1280px+): 48px.
8-step radius scale from sharp corners to full pills. The default --radius (8px) is used for most components.
0px 4px 6px 8px 10px 12px 16px 9999px Live demonstration of spacing tokens applied to a typical card composition, with annotated token values. This card uses the real design system tokens.
Card Title
Card description text demonstrating the spacing between title, description, and internal elements.
--gap-7 --gap-6 --gap-3 --gap-6 --gap-2 --radius-xl Fluid vs Static
Named spacing tokens (space-lg through space-4xl) use clamp() for seamless scaling. There are no breakpoint jumps. Numeric tokens (gap-0 through gap-10) remain fixed at all viewport sizes.
Mobile Surface Rules
On mobile viewports (below 768px), use a maximum of 2 surface tiers per visible area. Component spacing should use gap-4 (16px) to gap-6 (24px) for card padding on mobile.
Container Padding Progression
Container horizontal padding is clamp(20px, 5vw, 48px), providing 20px on mobile, scaling to 48px on wide desktops. This single token replaces the typical px-4 sm:px-6 md:px-8.