fix(theme): replace Gruvbox with Midnight, fix accent/info hue collisions and hardcoded colors

- Replace Gruvbox preset with Midnight (deep blue-purple, violet accent)
- Fix accent/info hue collisions in Nord, Monokai, Dracula, Solarized
- Fix Solarized error/warning collision (error-h 25->5) and WCAG contrast
- Make --color-skip-refresh-* follow --color-warning-h dynamically
- Replace hardcoded rgba(24,144,255) in onboarding.css with --color-accent
- Replace hardcoded #00B87A in import modals with --color-success
This commit is contained in:
Will Miao
2026-06-18 18:57:53 +08:00
parent c5c7373e10
commit 80ec9085dd
17 changed files with 137 additions and 94 deletions

View File

@@ -198,15 +198,20 @@ export function restoreFolderFilter() {
}
const CYCLE_ORDER = ['auto', 'light', 'dark'];
const PRESET_NAMES = ['default', 'nord', 'gruvbox', 'monokai', 'dracula', 'solarized'];
const PRESET_NAMES = ['default', 'nord', 'midnight', 'monokai', 'dracula', 'solarized'];
export { CYCLE_ORDER, PRESET_NAMES };
export function initTheme() {
const savedTheme = getStorageItem('theme') || 'auto';
const savedPreset = getStorageItem('theme_preset') || 'default';
// Migrate deprecated presets
let savedPreset = getStorageItem('theme_preset');
if (savedPreset === 'gruvbox') {
savedPreset = 'midnight';
setStorageItem('theme_preset', 'midnight');
}
applyTheme(savedTheme);
applyPreset(savedPreset);
applyPreset(savedPreset || 'default');
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
const currentTheme = getStorageItem('theme') || 'auto';