Skip to content

Add light theme with sidebar toggle#29

Open
keaganstokoe wants to merge 4 commits intochrysb:mainfrom
keaganstokoe:feat/light-theme
Open

Add light theme with sidebar toggle#29
keaganstokoe wants to merge 4 commits intochrysb:mainfrom
keaganstokoe:feat/light-theme

Conversation

@keaganstokoe
Copy link
Contributor

@keaganstokoe keaganstokoe commented Mar 17, 2026

Depends on #27. Diff will shrink to 6 file changes if merged.

What this does

Adds a light theme to alphaclaw, toggled via a sun/moon button in the sidebar header. The theme choice persists in localStorage.

This is a practical demonstration of the semantic token system from #27. The entire light theme is defined in CSS variable overrides. No component files were touched.

Changes

  • theme.css: [data-theme="light"] block overriding all CSS variables, plus light-mode overrides for hardcoded dark patterns (buttons, toggles, cards, grid texture, scrollbars)
  • shell.css: light-mode overrides for sidebar gradient, dropdown shadows, restart banner
  • theme-toggle.js: new Preact component with sun/moon icons, reads/writes localStorage
  • sidebar.js: added ThemeToggle to the brand area
  • login.html, setup.html: early <script> to apply saved theme before render (prevents flash)

Verification

  • Test suite passes
  • Manually verified login page and main app in both themes

keaganstokoe and others added 3 commits March 17, 2026 11:15
Introduce CSS variables (--text-bright, --status-*, --overlay) and a
shared tailwind-config.js with Tailwind color aliases backed by those
variables. Extract the inline Tailwind configs from login.html and
setup.html into the shared file.

This layer lets themes override colors in one file instead of touching
every component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Refactor all component files to use semantic color aliases (text-body,
text-bright, text-fg-muted, text-fg-dim, bg-field, bg-overlay,
text-status-*, bg-status-*-bg, border-status-*-border) instead of raw
Tailwind gray/red/yellow/green/cyan classes.

Theming now requires overriding CSS variables in theme.css only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a complete light theme toggled via a sun/moon button in the sidebar
header. Theme choice persists in localStorage and applies before render
to prevent flash.

This is a practical demonstration of the semantic token system: the
entire light theme is CSS variable overrides with zero component changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@keaganstokoe keaganstokoe marked this pull request as draft March 17, 2026 10:23
@keaganstokoe keaganstokoe marked this pull request as ready for review March 17, 2026 10:51
Use prefers-color-scheme to pick the initial theme instead of
hardcoding dark. A manual toggle still overrides via localStorage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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