mirror of https://github.com/usememos/memos.git
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 |
||
|---|---|---|
| .. | ||
| public | ||
| src | ||
| .gitignore | ||
| .prettierrc.js | ||
| MARKDOWN_STYLE_GUIDE.md | ||
| README.md | ||
| components.json | ||
| eslint.config.mjs | ||
| index.html | ||
| package.json | ||
| pnpm-lock.yaml | ||
| tsconfig.json | ||
| vite.config.mts | ||