Skip to content

Proportion system

Layout and size

Panes that share the screen by golden proportions, fixed 16 px sizing, and the size of every common element.

The golden section

Split a length so the whole is to the larger part as the larger part is to the smaller, and the parts are 61.8 percent and 38.2 percent:

a+ba=ab=φ⇒aa+b=1φ≈0.618,ba+b=1φ2≈0.382\frac{a+b}{a} = \frac{a}{b} = \varphi \quad\Rightarrow\quad \frac{a}{a+b} = \frac{1}{\varphi} \approx 0.618,\quad \frac{b}{a+b} = \frac{1}{\varphi^{2}} \approx 0.382

A rectangle whose sides are in this ratio loses its largest square and keeps the same shape. That is why the spiral on the Spacing page can go on forever.

11 / phi
Remove the largest square from a golden rectangle and what is left is a smaller golden rectangle. Cut a 1000 px tall sheet at 618 and 382.

On a phone, use it for vertical structure: the main content takes the upper 61.8 percent and secondary content the lower 38.2 percent, and bottom sheets snap at those heights. Cards that need an aspect ratio use 1.618 to 1 (landscape) or 1 to 1.618 (portrait).

Proportional layout

The size of things is fixed, and the arrangement is liquid. Every spacing, radius, type size and element size is a multiple of one unit, written --u, which is the 16 px base on every screen. A button is the same size on a phone and on a wide desktop, and text is the same size too.

What flexes is how much room things share. Panes take fractions of the screen, and a column of text is limited by how many characters it holds rather than by a width. Nothing is scaled up or down, so the layout always fills the screen and the elements stay familiar.

Panes and measure

The documentation panes share the screen by Fibonacci proportions: sidebar, article and outline are 233 : 610 : 144. They are fractions of the free width, not pixels, so the layout always fills the screen. Since 233 plus 377 is 610, the article is itself two golden parts.

Sidebar24%
Article62%
Outline15%
Proportions 233 : 610 : 144, shared out as fr tracks of whatever width the screen has. 233 + 377 = 610, and 377 / 233 and 610 / 377 are both phi to three decimals.

Prose is capped by its character count, not by a width. The measure is 76 characters, which is the upper end of comfortable reading, and because it is in ch it follows the type size. Text stays readable on a very wide screen while demos, tables and images fill the column.

Breakpoints

Breakpoints are Fibonacci numbers too, and each step is about phi wider than the one before: 377 is a large phone, 610 a small tablet, 987 a landscape tablet or a narrow desktop and 1597 a wide desktop. They are the only absolute widths in the system. Use them to change structure, such as dropping a pane, and let proportions handle everything else. Design for the smallest width first.

Element sizes

Every element dimension is a Fibonacci number from the spacing scale, in pixels.

ElementpxTokenRule
Border1f1Hairline
Focus ring2f2Outline width
Icon, small13f13Inline with caption text
Icon21f21Default
Icon, large34f34Empty states, feature rows
Control, compact34f34Drawn height. The hit area is still 55
Control55f55Drawn height of primary controls
Touch target55f55Minimum. Platforms ask for 44 (iOS) and 48 (Android)
Mark, avatar34f34Small. 55 regular, 89 large

Rules

  1. Draw compact, hit large. A control can be drawn at 34 px tall but its tappable area must reach 55 px, by padding the hit area and never by enlarging the drawn control.
  2. Cap text by characters. Reading text is at most 76 characters wide, never a pixel width, and a view has one reading column.
  3. Panes divide by proportion. If a view has two panes, the larger takes 61.8 percent. Three panes share the width as Fibonacci fractions. Never give a pane a pixel width.
  4. Never write a pixel size that is not on the scale. Positions and sizes are multiples of the unit from the scale. There is no separate column grid to keep in sync.
  5. Keep dark and glass surfaces legible. Size and spacing never replace contrast. Text on a translucent surface must still meet contrast after compositing.

Usage

html
<!-- Tailwind --><main class="grid grid-cols-[233fr_610fr_144fr] gap-f21 p-f21">  <p class="max-w-[var(--measure)]">…</p>  <div class="aspect-golden rounded-f21"></div></main>
css
/* the equivalent plain CSS */.screen {  display: grid;  grid-template-columns: 233fr 610fr 144fr;}.prose { max-width: var(--measure); }.card { aspect-ratio: var(--aspect-golden); }
scale.css
@theme static {  --u: 1rem;  --phi: 1.618;  --phi-inverse: 0.618;  --phi-inverse-squared: 0.382;  --measure: 76ch;  --container-f233: calc(var(--u) * 14.5625);  --container-f377: calc(var(--u) * 23.5625);  --container-f610: calc(var(--u) * 38.125);  --container-f987: calc(var(--u) * 61.6875);  --breakpoint-f377: 23.5625rem;  --breakpoint-f610: 38.125rem;  --breakpoint-f987: 61.6875rem;  --breakpoint-f1597: 99.8125rem;  --aspect-golden: 1.618 / 1;  --aspect-golden-portrait: 1 / 1.618;}