Design System Themes - HenriGrimm/Minnow GitHub Wiki
Themes
Sixteen composed themes on <html data-theme="{family}-{mode}">.
Families × modes
| Family | Dark | Light | Accent character |
|---|---|---|---|
| swamp (default) | swamp-dark |
swamp-light |
Muted green on cool neutrals |
| desert | desert-dark |
desert-light |
Warm amber on taupe |
| ocean | ocean-dark |
ocean-light |
Soft cyan on blue-tinted neutrals |
| coral | coral-dark |
coral-light |
Warm coral on graphite |
| mono | mono-dark |
mono-light |
Grayscale only |
| matrix | matrix-dark |
matrix-light |
Phosphor green on CRT black |
| human | human-dark |
human-light |
Burnt orange on near-black |
| mint | mint-dark |
mint-light |
Mint phosphor on cool charcoal |
Default when storage is empty: swamp-dark (DEFAULT_THEME_ID).
Family metadata (names, blurbs): THEME_FAMILY_META.
Storage
Canonical file: ~/.minnow/appearance.json (GET/PUT /api/config/appearance). localStorage is a first-paint cache and Vite-only fallback.
| Key | Purpose |
|---|---|
minnow.theme |
Explicit ThemeId when not following OS |
minnow.theme.followSystem |
'1' when mode tracks prefers-color-scheme |
minnow.theme.family |
Active family while follow-system is on |
Legacy values (light, dark, system, pre-rename families like sage→swamp) migrate on read in src/theme.ts.
Runtime pipeline
- FOUC boot — inline script in
index.htmlsetsdata-themebefore paint. Served HTML injectswindow.__MINNOW_APPEARANCE_BOOT__fromappearance.jsonso a new origin still has the saved palette. applyTheme()—src/theme.tssetsdata-theme, updatestheme-colormeta, and schedules a write toappearance.json.hydrateAppearanceFromServer()—src/appearance/persist.tsloads the home file after/api/configis up (server wins; localStorage migrates if the file was never saved).initTheme()—src/ui/theme.tswires hljs, xterm, custom tokens, fonts; addstheme-ready.- Transitions —
theme-transitions.cssguards first paint; text-entry controls usetransition: none(MIN-168 caret + macOS composer glyph lag).
Custom appearance
| Key | Purpose |
|---|---|
minnow.appearance.customEnabled |
Inline --mn-* overrides active |
minnow.appearance.customTokens |
JSON map of 26 core keys → color |
minnow.appearance.customAdvanced |
Per-token editor vs simplified seeds |
minnow.appearance.fonts |
UI + mono preset or upload refs |
Simplified mode derives full palettes via theme-derive.ts. Success is a fixed-hue semantic green (not a copy of accent); warning/folder shift from accent hue; danger comes from the danger seed.
Agent tools (Electron only): get_appearance, update_appearance, upload_appearance_asset in appearance-tools.ts.
Downstream consumers
| Consumer | File |
|---|---|
| CodeMirror | codemirror-theme.ts |
| xterm PTY | terminal-xterm-theme.ts |
| Research HTML reports | server/research/report-theme.js |
| Settings preview | settings-appearance-theme.ts |
Adding or editing a theme
- Add a
:root[data-theme="family-mode"]block intokens.csswith all core--mn-*keys. - Copy derived tokens (
--mn-selection-bg, shadows, tool-call, syntax) from an existing block. - Add wallpaper tints in
minnowos-tokens.csswhen the workspace shell uses them. - Register family in
THEME_FAMILIES/THEME_FAMILY_METAintheme.ts. - Run
test/theme.test.mtsandtest/theme-contrast.test.mts.