Skip to content
Sveltier
Mode
Theming

Design scale

Every size in Sveltier comes from the golden ratio, φ ≈ 1.618. Type and control sizes are powers of φ; spacing, corner radii and durations are Fibonacci numbers.

The golden ratio

Each step of a scale is a fixed power of φ larger than the one before, so values taken from different scales still relate to each other: a title is φ times the body text, and a medium control is φ² rem tall. Fibonacci numbers (2, 3, 5, 8, 13, 21, …) are the whole-number form of the same ratio: each is the sum of the two before it, and neighbours approach φ.

Sizes are in rem, so they follow the reader's font-size setting. Pick from the tokens instead of writing raw values and your own components stay on the same scale.

Type

Font sizes are quarter steps of φ from 1rem. Headline and display grow with the viewport.

TokenSizeφ stepSpecimen
--sv-text-label0.697rem · 11.2px−¾Total balance
--sv-text-xs0.7862rem · 12.6px−½Total balance
--sv-text-sm0.8867rem · 14.2px−¼Total balance
--sv-text-md1rem · 16px0Total balance
--sv-text-lg1.1278rem · 18px¼Total balance
--sv-text-xl1.272rem · 20.4px½Total balance
--sv-text-title1.618rem · 25.9px1Total balance
--sv-text-headline1.8249 – 2.3213rem1¼ – 1¾Balance
--sv-text-display2.618 – 4.2361rem2 – 3Balance

Line height

TokenValueφ stepUse
--sv-leading-tight1.1278¼Headings and controls
--sv-leading-snug1.272½Titles and tables
--sv-leading-normal1.6181Body text

Spacing

Spacing follows the Fibonacci sequence. The suffix is the size in pixels at the default 16px root, so --sv-space-21 is 21px.

TokenSizeSpecimen
--sv-space-20.125rem
--sv-space-30.1875rem
--sv-space-50.3125rem
--sv-space-80.5rem
--sv-space-130.8125rem
--sv-space-211.3125rem
--sv-space-342.125rem
--sv-space-553.4375rem
--sv-space-895.5625rem
--sv-space-1449rem

Controls and density

Control heights are half steps of φ; md, φ² ≈ 42px, is the default. Density moves a control a quarter step: --sv-density-compact is φ−¼ ≈ 0.887 and --sv-density-comfortable is φ¼ ≈ 1.128.

TokenHeightφ stepSpecimen
--sv-control-xs1.618rem · 25.9px1
--sv-control-sm2.0582rem · 32.9px1½
--sv-control-md2.618rem · 41.9px2
--sv-control-lg3.3302rem · 53.3px2½
--sv-control-xl4.2361rem · 67.8px3

Theme packs

Each pack picks its corner radii and durations from the Fibonacci sequence. Maison's square corners and Milano's pill-shaped controls are the two exceptions by design.

PackRadius sm · md · lg · xlDuration fast · normal · slow
Monolith5px · 8px · 13px · 21px144ms · 233ms · 377ms
Heritage2px · 3px · 5px · 5px233ms · 377ms · 610ms
Aurora8px · 13px · 21px · 34px144ms · 233ms · 377ms
Maison0px · 0px · 0px · 0px233ms · 377ms · 610ms
Milano8px · pill · 13px · 21px144ms · 233ms · 377ms

Layout

Two-column layouts split 61.8% / 38.2%. Grid tracks of 1.618fr and 1fr share the free space after the gap; --sv-golden-major and --sv-golden-minor give the same split as percentages.

split.css
/* 61.8% / 38.2% of the space left after the gap. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr);
  gap: var(--sv-space-21);
}

/* The same split as a width. */
.aside {
  inline-size: var(--sv-golden-minor);
}