Spacing and Rhythm
Overview
Spacing and rhythm is the consistent use of a fixed spacing scale
(Template Interface's own theme uses a 4px based scale, see
docs/DESIGN.md section 2.3) between elements, so
vertical spacing reads as intentional rather than eyeballed.
Why It Matters
Uneven whitespace reads as sloppy even when the colors and type on a page are otherwise correct, because inconsistent spacing is the first thing a viewer's eye notices, even before they consciously register why something looks off.
Core Principles
- Pick a scale, then only use values from it. A fixed set of spacing values (4, 8, 12, 16, 24px, and so on) is easier to apply consistently than a free choice every time.
- Vertical rhythm compounds across a whole page. One inconsistent gap is barely noticeable; a page full of them reads as unplanned.
- Proximity groups related elements. Items placed close together are read as one group; the same items spread apart are read as unrelated, even if their content did not change at all.
Interactive Demo
Consistent scale: every gap is the same --space-4
(16px) value, so the list reads as one evenly spaced group.
Common Mistakes
- Adjusting spacing by eye per section instead of pulling from a fixed scale, which drifts across a long page.
- Adding margin on a child element that is already inside a
container using CSS
gap, which doubles the intended space; see the responsive audit guidance indocs/DESIGN.mdsection 8.2. - Compressing spacing to fit more content instead of shortening the content, which makes a page feel cramped rather than dense.
Related Concepts
- Layout and Grid Systems: gutters are spacing applied to columns specifically.
- Visual Hierarchy: proximity is one of the tools hierarchy relies on.
- Responsive and Mobile First Thinking: spacing scales often need to shrink, not just reflow, at narrow widths.
Used In Templates
Demonstrated directly in the Portfolio Site, Blog and Article Site, E-commerce Storefront, Real Estate Listing Site, and Personal Resume and CV Site templates; see docs/PRD.md section 13.2.
Summary
Consistent spacing, pulled from a fixed scale rather than eyeballed per section, is what makes a page's rhythm feel intentional. Proximity, grouping related items closer together than unrelated ones, is the same principle applied to what spacing communicates, not just how much of it there is.