Skip to content

Add light/dark theme toggle#20

Merged
vecnode merged 1 commit into
mainfrom
light-dark-theme-toggle
Jul 11, 2026
Merged

Add light/dark theme toggle#20
vecnode merged 1 commit into
mainfrom
light-dark-theme-toggle

Conversation

@vecnode

@vecnode vecnode commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a theme toggle button to the top bar (next to the sidebar hamburger) for switching the whole app between light and dark.
  • Terminal (bottom-row) background is now light in the light theme (was always dark regardless of theme before); dark theme keeps the app's original always-dark terminal look exactly.
  • Every app colour is a CSS custom property (:root = light/default, [data-theme="dark"] = override), including a few literal colours that got moved to new tokens so they theme too (menu hover overlays, run/stop button grey).
  • The vendored Ace "textmate" theme hardcodes its own light colours; added targeted dark-mode overrides for the editor's base surface/text/gutter/selection so it's legible in dark mode, without vendoring a separate dark Ace theme (stays offline-first per the project's constraints).
  • Persists the chosen theme to localStorage so it's remembered across restarts; defaults to light.

Test plan

  • node --check public/script.js passes.
  • Built and ran locally; verified via the loopback URL in a browser:
    • Default theme is light; terminal background resolves to the light --editor-bg value.
    • Clicking the toggle switches data-theme to dark, flips the button's icon/label, and terminal/body/top-row/editor all resolve to the dark palette (terminal matches the app's original dark colours exactly).
    • Theme persists across a full page reload (localStorage).
    • Toggling back to light restores the light terminal background.
    • Ran an example sketch (Fireworks Burst) after toggling - zero sketch-error events, unaffected by the theme change.

Generated with Claude Code

- New button (#theme-toggle-button) next to the sidebar hamburger, wired in
  script.js's applyTheme()/initTheme(): flips [data-theme] on <html> and
  persists the choice to localStorage ("neo-theme"), defaulting to light.
- style.css: every colour is now a CSS custom property in :root (light,
  default) with a [data-theme="dark"] override block, so anything already
  using var(--token) re-themes automatically. A few remaining literal colours
  (menu hover overlays, run/stop button grey) were moved to new tokens
  (--overlay-hover/--overlay-active, --transport-bg/--transport-bg-hover) so
  they theme too.
- Terminal (bottom-row): --terminal-bg/--terminal-text now default to the
  light theme's editor-bg/muted colours (previously always dark regardless
  of theme); dark mode restores the app's original always-dark terminal
  colours exactly, so dark theme looks like how the app always looked there.
- The vendored Ace "textmate" theme hardcodes light colours internally; added
  [data-theme="dark"] .ace-tm overrides for base surface/text/gutter/
  selection/cursor so the editor is legible in dark mode too, without
  vendoring a whole separate dark Ace theme (stays offline-first). Syntax
  token colours are left as the vendored theme's - saturated enough to read
  on a dark background.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vecnode vecnode merged commit 4650bdc into main Jul 11, 2026
@vecnode vecnode deleted the light-dark-theme-toggle branch July 11, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant