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
--bgLight:oklch(0.99 0 0) Dark:oklch(0.13 0 0) Page - Surface
--surfaceLight:oklch(1 0 0) Dark:oklch(0.17 0 0) Cards, panels, inputs - Surface 2
--surface-2Light:oklch(0.955 0 0) Dark:oklch(0.22 0 0) Fields, hover, table headers - Ink
--fgLight:oklch(0.15 0 0) Dark:oklch(0.97 0 0) Primary text and strong borders - Muted ink
--mutedLight:oklch(0.45 0 0) Dark:oklch(0.72 0 0) Supporting text, labels - Border
--borderLight:oklch(0.86 0 0) Dark:oklch(0.32 0 0) Divider - Cobalt blue
--accentLight:#2447d8 Dark:#91a9ff One main action per screen, highlights - Soft blue
--accent-softLight:#edf1ff Dark:#17244b Accent badge background - Success
--successLight:oklch(0.5 0.13 150) Dark:oklch(0.74 0.14 150) Paid, saved - Warning
--warningLight:oklch(0.52 0.12 65) Dark:oklch(0.8 0.14 75) Due soon - Danger
--dangerLight:oklch(0.5 0.2 25) Dark:oklch(0.7 0.18 25) Error, delete, overdue - Archive yellow
--highlightLight:#edcf8f Dark:#e8bd72 Accent button, discoveries - Information
--infoLight:#2447d8 Dark:#91a9ff Hints and neutral updates - Oyen orange
--oyenLight:#a6551d Dark:#f0af6b Supporting identity, not a CTA - Mineral blue
--burungLight:#277587 Dark:#83c7d2 Discovery and bird character - Warm paper
--kertasLight:#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.
| Sample | Text · background | Light | Dark |
|---|---|---|---|
| --fg · --bg | 19.1:1AAA | 18.4:1AAA | |
| --muted · --bg | 7.2:1AAA | 8.1:1AAA | |
| --muted · --surface | 7.4:1AAA | 7.7:1AAA | |
| --muted · --surface-2 | 6.5:1AA | 7.0:1AA | |
| --accent · --bg | 6.9:1AA | 8.9:1AAA | |
| --accent · --accent-soft | 6.3:1AA | 6.7:1AA | |
| --accent-fg · --accent | 7.1:1AAA | 8.9:1AAA | |
| --highlight-fg · --highlight | 9.9:1AAA | 9.6:1AAA | |
| --danger-fg · --danger | 6.7:1AA | 6.9:1AA | |
| --danger · --bg | 6.5:1AA | 6.9:1AA | |
| --success · --bg | 5.5:1AA | 9.2:1AAA | |
| --warning · --bg | 5.5:1AA | 10.6:1AAA | |
| --oyen · --bg | 5.2:1AA | 10.6:1AAA | |
| --burung · --bg | 5.1:1AA | 10.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-sansHeadings, body text, controls. Variable 100–900. - Aa Gg 1234 Instrument Serif
font-serif italicItalic accents at heading ends; never body text. - Aa Gg 1234 IBM Plex Mono
font-monoNumbers, 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.
border-border-strongborder-bordershadow-popborder-dashedFocus ring · press Tab here
.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
| Rhythm | Duration | CSS variable | Used for | Preview |
|---|---|---|---|---|
| Responsive | 160 ms | --gerak-tanggap | Press, hover, toggle, tooltip | |
| Directed | 280 ms | --gerak-terarah | Panels, dialogs, accordions, state changes | |
| Expressive | 520 ms | — (character) | Character anticipation and small jumps | |
| Narrative | 900 ms | — (character) | Celebration sequences that return to calm |
cubic-bezier(0.2, 0.8, 0.2, 1)cubic-bezier(0.4, 0, 0.2, 1)- Distance
- kecil 4pxsedang 12pxlompat 28px
- Scale
- tekan 0.96antisipasi 0.94pulih 1.03
- Exit
--gerak-keluar140 ms: elements exit faster than they enter, keeping the interface light when closing.