Watch
0
0
Fork
You've already forked hyperhive
0

frontend: light-theme terminal contrast, theme before first paint, color-scheme, motion and focus defaults

Light theme: the terminal and code blocks sat on --crust, a mid grey there, so text was 2:1 to 3:1. They now use --code-bg, which keeps 95% of a light palette's background (58% of the dark one's, as before); scrims and shadows keep --crust. Dark --muted goes from 4.44:1 to 4.72:1 on --bg. The stored theme and motion overrides are set by a blocking boot script in the head (the page allows no inline script), so a light OS no longer paints light before the dark default; a test keeps its keys in step with the shell. color-scheme follows the palette, so native controls and scrollbars match a forced theme. Five infinite animations (dashboard banner, container icon, pending badge, warn banner, spinner) now honour reduced motion and the in-app motion setting, ConnectionDot uses the same three-rule shape as the others, and the hive-warn element honours the system preference. Keyboard focus gets a default ring, and the cancel button and pane divider keep a visible one.
This commit is contained in:
iris 2026-11-19 18:35:43 +01:00 • committed by mara
commit 3d88108c4f

View file

@ -67,15 +67,18 @@ default palette). Default hexes shown are Catppuccin Mocha.
| `--blue` | `base0D` | `#89b4fa` | links, interactive accent (distinct from cyan) |
| `--purple` | `base0E` | `#cba6f7` | accent — active tabs, links, highlights |
| `--pink` | `base0F` | `#f5c2e7` | thinking events |
| `--crust` | `mix(base00 58%, #000000)` | `#11111b` | terminal / code block background (below `--bg`) |
| `--muted` | `mix(base05 55.5%, base00)` | `#7f849c` | secondary / dimmed text |
| `--crust` | `mix(base00 58%, #000000)` | `#11111b` | scrims and shadows (below `--bg`) |
| `--code-bg` | `mix(base00 58%, #000000)` | `#11111b` | terminal / code block background |
| `--muted` | `mix(base05 58%, base00)` | `#8489a1` | secondary / dimmed text |
| `--subtext0` | `mix(base05 77.7%, base00)` | `#a6adc8` | toolbar/status text; dimmer than `--fg`, lighter than `--muted` |
The shares in the `--muted` and `--subtext0` rows are the dark palette's. The light
palette keeps more of the text colour (85% and 93%, set in `colors.css` as
The shares in the `--muted`, `--subtext0` and `--code-bg` rows are the dark palette's.
The light palette keeps more of the text colour (85% and 93%, set in `colors.css` as
`--muted-share` and `--subtext0-share`), because the dark shares leave its dimmed
text at 2.4:1 against a card, short of the 4.5:1 AA asks for. A palette that sets
neither variable, such as a generated one, keeps the dark shares.
text at 2.4:1 against a card, short of the 4.5:1 AA asks for. For the same reason it
keeps 95% of its background in `--code-bg` (`--code-bg-share`), as `--crust` is a mid
grey on a light palette and text on it fell to 2:1. A palette that sets none of these
variables, such as a generated one, keeps the dark shares.
## Common mistakes
@ -150,7 +153,7 @@ wholesale (for example the stylix path, which writes a single unconditional
| Slot | Default | Standard base16 role | Mapped to |
| -------- | --------- | -------------------- | ---------------------------------------------------------- |
| `base00` | `#1e1e2e` | default bg | `--bg`, (darkened) `--crust` |
| `base00` | `#1e1e2e` | default bg | `--bg`, (darkened) `--crust` and `--code-bg` |
| `base01` | `#181825` | lighter bg | `--bg-elev` |
| `base02` | `#313244` | selection/surface | `--border` |
| `base03` | `#45475a` | comments/dim surface | `--purple-dim` |
@ -169,8 +172,9 @@ wholesale (for example the stylix path, which writes a single unconditional
Notes for theme authors:
- **`--crust`, `--muted`, `--subtext0` have no own slot** — they're
derived via `color-mix()` over base16 (`--crust` = a darkened `base00`;
- **`--crust`, `--code-bg`, `--muted`, `--subtext0` have no own slot** — they're
derived via `color-mix()` over base16 (`--crust` and `--code-bg` = a darkened
`base00`, `--code-bg` less so on a light palette;
`--muted`/`--subtext0` = `base05`↔`base00` blends). They still track a
swap automatically; no generator action needed.
- A standard Catppuccin base16 scheme uses **teal** for `base0C`;