Skip to content

feat(desktop): add 'Follow system' theme mode#1262

Open
alecthomas wants to merge 1 commit into
mainfrom
feat/follow-system-theme
Open

feat(desktop): add 'Follow system' theme mode#1262
alecthomas wants to merge 1 commit into
mainfrom
feat/follow-system-theme

Conversation

@alecthomas

Copy link
Copy Markdown
Collaborator

Summary

Adds a "Follow system" checkbox in Appearance settings that auto-switches between the user's selected theme and its light/dark counterpart based on the OS color scheme (prefers-color-scheme media query).

How it works

  1. User selects a theme (e.g. "GitHub Light")
  2. Enables "Follow system" checkbox
  3. When the OS switches to dark mode → app automatically applies "GitHub Dark"
  4. When OS returns to light mode → back to "GitHub Light"

Changes

File What
desktop/src/shared/theme/theme-loader.ts Added THEME_PAIRS map (17 bidirectional pairs), getThemePair(), and resolveSystemTheme() helper
desktop/src/shared/theme/ThemeProvider.tsx Added followSystem state persisted to localStorage, prefers-color-scheme media query listener, effective theme resolution
desktop/src/features/settings/ui/SettingsPanels.tsx Added "Follow system" checkbox with contextual hint showing the paired theme

UI Details

  • Checkbox with monitor icon at the top of the theme list
  • Shows hint text like "Switches to GitHub Dark in dark mode"
  • If a theme has no known pair, shows a helpful message
  • The effective (auto-switched) theme gets a subtle monitor icon indicator in the list

Theme pairs (17 total)

Catppuccin Latte ↔ Mocha, Everforest, GitHub (3 variants), Gruvbox (3 variants), Kanagawa Lotus ↔ Wave, Light/Dark Plus, Material, Min, One, Rose Pine, Slack, Solarized, Vitesse

Testing

  • desktop-check ✅ (TypeScript)
  • desktop-build ✅ (Vite)
  • All lint/format checks pass

Closes the feature request from #buzz-bugs.


Requested by @alecthomas in buzz-bugs

Adds a checkbox in Appearance settings that auto-switches between the
user's selected theme and its light/dark counterpart based on the OS
color scheme (prefers-color-scheme media query).

Implementation:
- theme-loader.ts: adds THEME_PAIRS map and resolveSystemTheme() helper
- ThemeProvider.tsx: adds followSystem state, media query listener, and
  resolves the effective theme based on system preference
- SettingsPanels.tsx: adds Follow System checkbox with contextual hint
  showing which paired theme will be used

When enabled with e.g. 'GitHub Light' selected, the app automatically
switches to 'GitHub Dark' when the OS enters dark mode, and back when
it returns to light mode. Themes without a known pair show a hint.

Co-authored-by: Alec Thomas <aat@block.xyz>
Signed-off-by: Alec Thomas <aat@block.xyz>
Co-authored-by: Goose <opensource@block.xyz>
@alecthomas alecthomas force-pushed the feat/follow-system-theme branch from 559aa73 to f55662a Compare June 25, 2026 02:20
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