Creating consistent spatial rhythm
A spacing system is based on a base unit (typically 4px or 8px), with all spacing being multiples of this unit. This creates visual rhythm and consistency.
/* 4px Base Grid System */
--space-1: 4px; /* Extra small */
--space-2: 8px; /* Small */
--space-3: 12px; /* Small-medium */
--space-4: 16px; /* Standard */
--space-6: 24px; /* Medium */
--space-8: 32px; /* Large */
--space-12: 48px; /* Extra large */
--space-16: 64px; /* Section spacing */Use browser pixel grid overlays during development to ensure all elements align to the grid.