Skip to content

feat: add Light/Dark/Auto color scheme toggle#18

Merged
DGINXREAL merged 4 commits into
mainfrom
feature/color-scheme-toggle
Jun 18, 2026
Merged

feat: add Light/Dark/Auto color scheme toggle#18
DGINXREAL merged 4 commits into
mainfrom
feature/color-scheme-toggle

Conversation

@DGINXREAL

Copy link
Copy Markdown
Member

Summary

Adds a color scheme toggle to the sidebar with three modes — Light, Dark, and Auto (default). Auto follows the OS prefers-color-scheme; the choice persists per device via localStorage. Frontend-only, no backend/DB changes.

The UI was already dark-mode-ready (43 components use dark: variants), but Tailwind v4 was silently keying dark: off the OS media query with no way to override. This switches to a class-based .dark strategy and adds the control + persistence.

Changes

  • resources/css/app.css@custom-variant dark to drive dark: from a .dark class on <html> instead of the media query.
  • resources/views/app.blade.php — blocking inline script in <head> that applies the stored theme before first paint (no flash).
  • resources/js/lib/theme.tsTheme type + resolveIsDark / getStoredTheme / applyTheme helpers and a useTheme hook (subscribes to OS changes live while in Auto).
  • resources/js/Components/ThemeToggle.tsx — cycling icon button (Light → Dark → Auto), styled to match existing sidebar buttons.
  • resources/js/Components/Sidebar.tsx — mounts the toggle above the project switcher.

Verification

  • ddev npm run build — passes (TS check + Vite build)
  • ddev composer run test — 142 passed (618 assertions)
  • ddev exec ./vendor/bin/pint --test — passes (138 files)
  • Manual: cycling, reload persistence, live OS-follow in Auto, no flash on load

🤖 Generated with Claude Code

@DGINXREAL DGINXREAL requested a review from noidee-dev as a code owner June 18, 2026 14:42
@DGINXREAL DGINXREAL merged commit 0c96262 into main Jun 18, 2026
3 checks passed
@DGINXREAL DGINXREAL deleted the feature/color-scheme-toggle branch June 18, 2026 14:46
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