Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Living wiki of UI design patterns and best practices built with Fumadocs, Next.js, and Base UI components.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/visual-consistent-spacing-scale.md
1---2title: Use a Consistent Spacing Scale3impact: HIGH4tags: visual, spacing, scale, consistency5---67## Use a Consistent Spacing Scale89Don't use arbitrary pixel values for spacing. Define a scale and stick to it throughout the UI.1011**Incorrect (arbitrary values):**1213```css14.header { padding: 17px; }15.card { margin-bottom: 13px; }16.section { gap: 22px; }17```1819**Correct (consistent scale):**2021```css22:root {23--space-1: 4px;24--space-2: 8px;25--space-3: 12px;26--space-4: 16px;27--space-5: 24px;28--space-6: 32px;29--space-7: 48px;30}3132.header { padding: var(--space-4); }33.card { margin-bottom: var(--space-3); }34.section { gap: var(--space-5); }35```36