2026-11-08·作者 Sijie Wang

spacing-system

The 8pt grid is a closed spacing scale built on multiples of 8px that makes layouts look ordered and spacing decisions fast.

Spacing system — the 8pt grid

A spacing system is a closed scale of spacing values that every margin, padding, and gap on a page must come from. In the 8pt grid, that scale is built on a base of 8px: 8, 16, 24, 32, 48, 64, 96, and so on. Extra-tight places use the 4pt half-step: 4, 12, 20. Nothing else is allowed — never 13px, never 17px, never a number eyeballed for one element alone.

Mechanism: one base makes the eye sense a pattern

The mechanism is constraint, not decoration. When every gap is a multiple of the same base, gaps relate to each other in simple ratios — 8 to 16 is 1:2, 16 to 32 is 1:2, 24 to 48 is 1:2. The eye does not measure pixels; it senses whether gaps repeat and relate. Repeated, related gaps read as order. Unrelated gaps read as noise, even when each individual gap looks fine on its own.

A closed scale also changes how decisions are made. Without a scale, every margin is a fresh decision: is this gap 14px or 15px or 18px? With a scale, the decision is a choice from a short list: 16 or 24? That is faster, and it keeps two people working on the same page from drifting apart, because both are choosing from the same list.

Why 8

Eight is chosen because it divides cleanly and scales cleanly. It is divisible by 2 and by 4, so the same base serves both coarse steps (32, 48, 64) and fine steps (4, 8, 12). Screen pixel densities are mostly even numbers, so multiples of 8 scale across densities without landing on half-pixels that blur edges. A base of 5 or 7 would not divide as evenly; a base of 10 would leave no useful half-step for tight places.

The scale

Fix one scale and use it everywhere:

4, 8, 16, 24, 32, 48, 64, 964,\ 8,\ 16,\ 24,\ 32,\ 48,\ 64,\ 96

Every margin, padding, and gap comes from this list. The list is short on purpose: a short list forces real choices and keeps the page consistent. If a gap feels like it needs a value between two steps — say between 16 and 24 — the answer is to pick one of the two, not to invent 20 for that one spot. The slight imperfection of the nearest step is cheaper than breaking the pattern.

Practice: apply the scale to everything

Start from the smallest unit and work outward. Text-to-text gaps take the small steps (8, 16); component internals take the middle steps (16, 24); sections and page margins take the large steps (32, 48, 64). The same value means the same visual relationship wherever it appears: a 16px gap inside a card and a 16px gap between two buttons should feel like the same amount of space, because they are the same number.

Multilingual note: the grid does not change with the language

The 8pt grid is layout structure, independent of text content, so every language uses the same grid. What changes across languages is the text: the same sentence differs in length, and line-height may adjust per language. The grid does not change. A page translated from English to Chinese keeps its 16px card padding, its 32px section gap, and its 24px page margin; only the words inside get longer or shorter.

Lucerna example: the reading page

On the Lucerna reading page, paragraph spacing, control spacing, and section spacing all come from the same scale. Paragraphs are separated by one step, the controls under the text by another, and the sections of the page by a larger one. Because the steps are shared, the reader senses one rhythm from the top of the page to the bottom instead of a different rhythm in each area.

Good and bad examples

GOOD — every gap picked from the scale: card padding 16px, section gap 32px, page margin 24px. Each value is on the list, so the gaps relate to each other and the page looks ordered.

BAD — 13px here, 17px there, eyeballed per element. Each gap was chosen in isolation, so no two gaps relate, and the page looks slightly off everywhere without any single obvious mistake.

BAD — the same visual gap measuring 15px in one place and 19px in another, so nothing lines up. The two gaps were meant to be the same relationship, but because neither came from the scale, the eye catches the mismatch and reads it as carelessness.

GOOD — a tight list that needs a half-step uses 4pt values (4, 12, 20) instead of inventing 6px or 10px. The half-step is still part of the system, so the pattern holds even at small sizes.

BAD — inventing 20px for one spot because 16 felt too small and 24 felt too big. The one-off value breaks the scale, and the next person to touch the page has no way to know whether 20 is now allowed everywhere.

關於這一條

sijie 的一條 wiki 條目。本站的 AI 以同一套語料庫為依據、以 sijie 的口吻作答,並附有指向此類條目的引用——回答會花 sijie 的錢,所以它在存取碼後等待: 輸入存取碼 →