Skip to content
Theme

Chapter 01 · Foundations

Color, type, form.

Every component reads these tokens. Change them in layout.css, and the whole site, including this book, follows.

01.1 — Color

Ink, white, cobalt.

Supporting colours have clear roles and do not replace the accent. Samples follow the active theme; light and dark values appear below.

  • Background --bg Light:oklch(0.99 0 0) Dark:oklch(0.13 0 0) Page
  • Surface --surface Light:oklch(1 0 0) Dark:oklch(0.17 0 0) Cards, panels, inputs
  • Surface 2 --surface-2 Light:oklch(0.955 0 0) Dark:oklch(0.22 0 0) Fields, hover, table headers
  • Ink --fg Light:oklch(0.15 0 0) Dark:oklch(0.97 0 0) Primary text and strong borders
  • Muted ink --muted Light:oklch(0.45 0 0) Dark:oklch(0.72 0 0) Supporting text, labels
  • Border --border Light:oklch(0.86 0 0) Dark:oklch(0.32 0 0) Divider
  • Cobalt blue --accent Light:#2447d8 Dark:#91a9ff One main action per screen, highlights
  • Soft blue --accent-soft Light:#edf1ff Dark:#17244b Accent badge background
  • Success --success Light:oklch(0.5 0.13 150) Dark:oklch(0.74 0.14 150) Paid, saved
  • Warning --warning Light:oklch(0.52 0.12 65) Dark:oklch(0.8 0.14 75) Due soon
  • Danger --danger Light:oklch(0.5 0.2 25) Dark:oklch(0.7 0.18 25) Error, delete, overdue
  • Archive yellow --highlight Light:#edcf8f Dark:#e8bd72 Accent button, discoveries
  • Information --info Light:#2447d8 Dark:#91a9ff Hints and neutral updates
  • Oyen orange --oyen Light:#a6551d Dark:#f0af6b Supporting identity, not a CTA
  • Mineral blue --burung Light:#277587 Dark:#83c7d2 Discovery and bird character
  • Warm paper --kertas Light:#f2eadb Dark:#302c25 Story and artefact backgrounds

Bit's body · three voxel faces, visor, LEDs

  • Top face Light:#64708c Dark:#ffffff
  • Front face Light:#35415d Dark:#dde4f4
  • Side face Light:#1b2440 Dark:#8f9dbc
  • Visor Light:#0b0b0d Dark:—
  • Face LEDs Light:#f4f4f5 Dark:—

Bit follows the site theme, rather than scene lighting: the top face is brightest and the side darkest, keeping the 3D shape readable in both themes.

01.2 — Contrast

Readable in both themes.

Text and background pairs actually used by components. Values come from the same layout.css as contrast.test.ts; below 4.5:1 the test fails.

WCAG 2.2 contrast for regular text. AA ≥ 4.5:1, AAA ≥ 7:1.
SampleText · backgroundLightDark
--fg · --bg19.1:1AAA18.4:1AAA
--muted · --bg7.2:1AAA8.1:1AAA
--muted · --surface7.4:1AAA7.7:1AAA
--muted · --surface-26.5:1AA7.0:1AA
--accent · --bg6.9:1AA8.9:1AAA
--accent · --accent-soft6.3:1AA6.7:1AA
--accent-fg · --accent7.1:1AAA8.9:1AAA
--highlight-fg · --highlight9.9:1AAA9.6:1AAA
--danger-fg · --danger6.7:1AA6.9:1AA
--danger · --bg6.5:1AA6.9:1AA
--success · --bg5.5:1AA9.2:1AAA
--warning · --bg5.5:1AA10.6:1AAA
--oyen · --bg5.2:1AA10.6:1AAA
--burung · --bg5.1:1AA10.6:1AAA

Oyen orange and mineral blue pass for text but remain supporting colours. Thin borders (--border) are deliberately muted and are not used for text.

01.3 — Typography

Compact, calm typography.

Three families, one scale. Display headings are compact and balanced (text-wrap: balance); body text is spacious; labels are small capitals. There is no Typography component: use these classes.

  • Aa Gg 1234 Inter Tight font-sans Headings, body text, controls. Variable 100–900.
  • Aa Gg 1234 Instrument Serif font-serif italic Italic accents at heading ends; never body text.
  • Aa Gg 1234 IBM Plex Mono font-mono Numbers, code, invoice numbers, technical labels.
h1 · display display text-6xl sm:text-8xl
Careful.
h2 · display display text-4xl sm:text-5xl
Personally crafted
h3 text-2xl font-semibold
A clear scope
h4 text-xl font-semibold
Before the first line of code
Lead text-lg leading-relaxed text-muted
From design to server, explained in plain language.
Paragraph leading-relaxed
Scope and price are written before the first code, then reviewed together.
Serif accent font-serif text-4xl italic
with care.
Label label
Package 02 — Recommended
Control ui text-xs
Send message
Numbers font-mono text-sm tabular-nums
INV/2026/014 · Rp 6.500.000
Small text-sm text-muted
Updated 20 October 2026.

Quotation · list · inline code

Found the pattern. Try one more step.
  • One idea per item.
  • Short sentences, verbs first.

Import from #lib/ui/button.svelte.

Rules

One display heading per screen. The large heading leads; everything else follows the body scale.

Serif is an accent only. Two or three words at the end of a heading. In Japanese and Chinese, regular bold replaces italic serif.

Numbers always use mono. Tabular figures keep price and time columns aligned.

01.4 — Lines and shadows

Square corners, 2 px, hard shadows.

No rounded corners or soft shadows. Depth comes from firm lines and offset solid shadows.

Strong borderborder-border-strong
Dividerborder-border
Elevatedshadow-pop
Empty · dragborder-dashed

Focus ring · press Tab here

Link

.focus-ring adds a 2 px cobalt outline with a 2 px offset to every control. Using an outline keeps focus visible in high contrast mode. Small touch targets are enlarged to at least 24 px with after:-inset-[3px].

01.5 — Grid

Twelve columns.

Labels in columns 1–3, titles and content in 4–12. The same pattern runs through every section of the site and this book, including the heading above.

Columns 1–3 · label

Columns 4–12 · title and content. On mobile they stack with a 16 px gutter. The bordered grid, whose cells share borders, uses Kisi + KisiSel from lib/ui, like the chapter cards on the cover.

01.6 — UI motion tokens

Interface rhythm.

Durations and curves used by components. Responsive and directed motion are also CSS variables in layout.css; motion-study.test.ts keeps their values aligned with GERAK in motion-study.ts.

Compare durations · firm curve

Reduced motion makes every transition instant.
RhythmDurationCSS variableUsed forPreview
Responsive160 ms--gerak-tanggapPress, hover, toggle, tooltip
Directed280 ms--gerak-terarahPanels, dialogs, accordions, state changes
Expressive520 ms— (character)Character anticipation and small jumps
Narrative900 ms— (character)Celebration sequences that return to calm
Calm cubic-bezier(0.2, 0.8, 0.2, 1)
Firm cubic-bezier(0.4, 0, 0.2, 1)
Distance
kecil 4pxsedang 12pxlompat 28px
Scale
tekan 0.96antisipasi 0.94pulih 1.03
Exit
--gerak-keluar 140 ms: elements exit faster than they enter, keeping the interface light when closing.