Skip to main content

Module theme

Module theme 

Source
Expand description

Colour themes for the dashboard: the core’s palettes as CSS custom properties.

/style.css is written against var(--bg), var(--accent) … with the Default theme as fallback; a <style> block from css (re-emitted by the live shard whenever the theme select changes) overrides those variables.

Constants§

CYBERPUNK_CSS
Extra component styling for the Cyberpunk theme (cyberpunk.net look): yellow slab buttons with clipped corners, uppercase display type, hard-edged panels with a cut corner, neon glow and a faint scanline overlay.
SYSTEM_INDEX
Pseudo-index meaning “follow the system” (one past the last preset).

Functions§

catalogue
Every theme with its colours, for /api/themes.
css
CSS custom properties for the theme at index (clamped), as one :root{…} rule.
name
The name for a theme index (SYSTEM_INDEX → “System”; out of range is clamped).
names
Theme names for the select: “System” first, then the presets in canonical order.
resolve
Pick the theme: an explicit, valid requested name wins, otherwise saved. "System" resolves to SYSTEM_INDEX.
save_index
Remember index for the TUI and GUI (best effort).
saved_index
The saved theme (SYSTEM_INDEX when following the system), shared with the TUI and GUI.
series_var
var(--sN) for a tool (pi, claude, …); the accent for anything else.