Add light/dark theme toggle#20
Merged
Merged
Conversation
- 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>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
: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).localStorageso it's remembered across restarts; defaults to light.Test plan
node --check public/script.jspasses.--editor-bgvalue.data-themetodark, 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).localStorage).sketch-errorevents, unaffected by the theme change.Generated with Claude Code