From 968a775e7beb81eec1b541c588c01e7c239f3329 Mon Sep 17 00:00:00 2001 From: Samidy Date: Sat, 20 Dec 2025 14:39:41 -0800 Subject: [PATCH 1/2] Fix for preset themes not saving (#4465) * shitty (probably not working) fix for preset themes * tf * i saved theme data locally fuck * 99% chance this wont work * make default christmas --- docs/.vitepress/theme/components/ColorPicker.vue | 10 ++++++++-- docs/.vitepress/theme/themes/themeHandler.ts | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/.vitepress/theme/components/ColorPicker.vue b/docs/.vitepress/theme/components/ColorPicker.vue index efafa54ba..cce2ef535 100644 --- a/docs/.vitepress/theme/components/ColorPicker.vue +++ b/docs/.vitepress/theme/components/ColorPicker.vue @@ -8,7 +8,7 @@ import type { Theme } from '../themes/types' import Switch from './Switch.vue' type ColorNames = keyof typeof colors -const selectedColor = useStorage('preferred-color', 'swarm') +const selectedColor = useStorage('preferred-color', 'christmas') // Use the theme system const { amoledEnabled, setAmoledEnabled, setTheme, state, mode, themeName } = useTheme() @@ -196,7 +196,13 @@ const normalizeColorName = (colorName: string) => colorName.slice(1).replaceAll(/-/g, ' ') onMounted(async () => { - // Don't auto-apply color theme - only apply when user explicitly selects + // apply saved theme on load + if (selectedColor.value) { + const theme = generateThemeFromColor(selectedColor.value) + themeRegistry[`color-${selectedColor.value}`] = theme + await nextTick() + setTheme(`color-${selectedColor.value}`) + } // Wait for next tick to ensure theme handler is fully initialized await nextTick() }) diff --git a/docs/.vitepress/theme/themes/themeHandler.ts b/docs/.vitepress/theme/themes/themeHandler.ts index 682f6c7f7..eb8ce5a29 100644 --- a/docs/.vitepress/theme/themes/themeHandler.ts +++ b/docs/.vitepress/theme/themes/themeHandler.ts @@ -21,6 +21,7 @@ import { themeRegistry } from './configs' const STORAGE_KEY_THEME = 'vitepress-theme-name' const STORAGE_KEY_MODE = 'vitepress-display-mode' const STORAGE_KEY_AMOLED = 'vitepress-amoled-enabled' +const STORAGE_KEY_THEME_DATA = 'vitepress-theme-data' export class ThemeHandler { private state = ref({ @@ -42,7 +43,6 @@ export class ThemeHandler { const savedMode = localStorage.getItem(STORAGE_KEY_MODE) as DisplayMode | null const savedAmoled = localStorage.getItem(STORAGE_KEY_AMOLED) === 'true' - // Set theme if (themeRegistry[savedTheme]) { this.state.value.currentTheme = savedTheme this.state.value.theme = themeRegistry[savedTheme] @@ -74,7 +74,7 @@ export class ThemeHandler { }) } - private applyTheme() { + public applyTheme() { if (typeof document === 'undefined') return const { currentMode, theme } = this.state.value @@ -390,4 +390,4 @@ export function useTheme() { toggleAmoled: () => handler.toggleAmoled(), state } -} \ No newline at end of file +} From df265614b8f107afd30a8deaa9580aa6f8a68d98 Mon Sep 17 00:00:00 2001 From: Yadnesh Tambe <106799295+yadneshx17@users.noreply.github.com> Date: Sun, 21 Dec 2025 04:09:53 +0530 Subject: [PATCH 2/2] fix: mail icon color white (#4463) --- docs/.vitepress/theme/components/Feedback.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.vitepress/theme/components/Feedback.vue b/docs/.vitepress/theme/components/Feedback.vue index 162e1810d..6660dd44c 100644 --- a/docs/.vitepress/theme/components/Feedback.vue +++ b/docs/.vitepress/theme/components/Feedback.vue @@ -153,7 +153,7 @@ const toggleCard = () => (isCardShown.value = !isCardShown.value)