refactor(theme): remove wood themes from core theme system
- Remove wood-light, wood-dark, wood-mahogany from ThemeType - Remove wood theme gradient logic from applyTheme() - Wood themes will be reimplemented as separate paneling feature - Paneling will target dashboard bookshelf background only
This commit is contained in:
+6
-33
@@ -11,10 +11,7 @@ type ThemeType =
|
|||||||
| 'catppuccin-mocha'
|
| 'catppuccin-mocha'
|
||||||
| 'catppuccin-macchiato'
|
| 'catppuccin-macchiato'
|
||||||
| 'catppuccin-frappe'
|
| 'catppuccin-frappe'
|
||||||
| 'catppuccin-latte'
|
| 'catppuccin-latte';
|
||||||
| 'wood-light'
|
|
||||||
| 'wood-dark'
|
|
||||||
| 'wood-mahogany';
|
|
||||||
|
|
||||||
const DEFAULT_THEME: ThemeType = 'tokyo-night';
|
const DEFAULT_THEME: ThemeType = 'tokyo-night';
|
||||||
const THEME_STORAGE_KEY = 'theme';
|
const THEME_STORAGE_KEY = 'theme';
|
||||||
@@ -22,35 +19,11 @@ const TOKEN_STORAGE_KEY = 'token';
|
|||||||
|
|
||||||
// Apply theme to document body
|
// Apply theme to document body
|
||||||
const applyTheme = (theme: string): void => {
|
const applyTheme = (theme: string): void => {
|
||||||
// Handle wood themes with gradients
|
// Apply regular theme only
|
||||||
if (theme.startsWith('wood-')) {
|
document.body.className = `theme-${theme}`;
|
||||||
document.body.className = `theme-${theme}`;
|
document.body.style.background = '';
|
||||||
|
document.body.style.backgroundSize = '';
|
||||||
let woodGradient = '';
|
document.body.style.backgroundAttachment = '';
|
||||||
switch (theme) {
|
|
||||||
case 'wood-light':
|
|
||||||
woodGradient = 'linear-gradient(135deg, #deb887 0%, #d2a679 50%, #c9975b 100%)';
|
|
||||||
break;
|
|
||||||
case 'wood-dark':
|
|
||||||
woodGradient = 'linear-gradient(135deg, #8b7355 0%, #6b5344 50%, #5a4636 100%)';
|
|
||||||
break;
|
|
||||||
case 'wood-mahogany':
|
|
||||||
woodGradient = 'linear-gradient(135deg, #a0522d 0%, #8b4513 50%, #7a3c10 100%)';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
woodGradient = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
document.body.style.background = woodGradient;
|
|
||||||
document.body.style.backgroundSize = 'cover';
|
|
||||||
document.body.style.backgroundAttachment = 'fixed';
|
|
||||||
} else {
|
|
||||||
// Apply regular theme
|
|
||||||
document.body.className = `theme-${theme}`;
|
|
||||||
document.body.style.background = '';
|
|
||||||
document.body.style.backgroundSize = '';
|
|
||||||
document.body.style.backgroundAttachment = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
localStorage.setItem(THEME_STORAGE_KEY, theme);
|
localStorage.setItem(THEME_STORAGE_KEY, theme);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user