memos/web
Claude 64d338ead9
feat(web): standardize theme system with auto sync option
This commit addresses issue #5190 by implementing a standardized theme
system following GitHub's approach and fixing theme persistence bugs.

Key changes:
- Add "Sync with system" theme option that auto-switches between light/dark
- Rename theme options: "Default Light" → "Light", "Default Dark" → "Dark"
- Fix theme persistence: changes now update instanceStore immediately
- Fix initialization: respect user's saved theme instead of hardcoding "default"
- Add OS preference listener: auto-update when system theme changes
- Set "system" as the default theme for new users

The theme system now offers:
- System (auto) - follows OS dark/light preference (NEW, default)
- Light - always light theme
- Dark - always dark theme
- Paper - custom light theme
- Whitewall - custom light theme

Technical improvements:
- Added resolveTheme() to handle "system" → actual theme resolution
- Added setupSystemThemeListener() for OS preference change detection
- Updated validation in instance store to include "system"
- Fixed PreferencesSection to immediately apply theme changes
- Updated ThemeSelect with Monitor icon for system theme

Fixes #5190
2025-11-07 02:25:41 +00:00
..
public chore: enhance site.webmanifest in firefox (#4828) 2025-07-08 19:56:46 +08:00
src feat(web): standardize theme system with auto sync option 2025-11-07 02:25:41 +00:00
.gitignore chore: update gitignore 2025-04-17 23:11:36 +08:00
.prettierrc.js chore: fix linter 2025-03-02 15:40:16 +08:00
MARKDOWN_STYLE_GUIDE.md chore: remove unused syntax 2025-10-27 08:31:57 +08:00
README.md chore: tweak readme 2024-02-23 08:25:54 +08:00
components.json feat: themes (#4824) 2025-07-07 20:13:22 +08:00
eslint.config.mjs refactor: migrate eslint 2025-04-01 00:04:43 +08:00
index.html chore: remove fixed theme color 2025-07-15 23:26:07 +08:00
package.json chore: remove unused syntax 2025-10-27 08:31:57 +08:00
pnpm-lock.yaml chore: remove unused syntax 2025-10-27 08:31:57 +08:00
tsconfig.json refactor: update import prefix with alias (#1433) 2023-04-01 16:03:14 +08:00
vite.config.mts refactor: update markdown parser 2025-10-26 11:28:40 +08:00

README.md

The frontend of Memos