From 884d63e3c643391ccc11530519b2414933f187c7 Mon Sep 17 00:00:00 2001 From: fmhyhalloweenshit Date: Fri, 2 Jan 2026 15:16:02 +0300 Subject: [PATCH] kill everyone --- docs/.vitepress/theme/themes/themeHandler.ts | 12 +++++++++--- docs/.vitepress/theme/themes/types.ts | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/.vitepress/theme/themes/themeHandler.ts b/docs/.vitepress/theme/themes/themeHandler.ts index 9b95a5033..1608b4658 100644 --- a/docs/.vitepress/theme/themes/themeHandler.ts +++ b/docs/.vitepress/theme/themes/themeHandler.ts @@ -26,7 +26,7 @@ export class ThemeHandler { private state = ref({ currentTheme: 'color-swarm', currentMode: 'light' as DisplayMode, - theme: themeRegistry['color-swarm'] + theme: null }) private amoledEnabled = ref(false) @@ -77,6 +77,10 @@ export class ThemeHandler { if (typeof document === 'undefined') return const { currentMode, theme } = this.state.value + if (!theme) { + this.applyDOMClasses(currentMode) + return + } const modeColors = theme.modes[currentMode] this.applyDOMClasses(currentMode) @@ -309,10 +313,12 @@ export class ThemeHandler { } private ensureColorPickerColors() { + const theme = this.state.value.theme + if (!theme) return // If theme doesn't specify brand colors, force ColorPicker to reapply its selection const currentMode = this.state.value.currentMode - const modeColors = this.state.value.theme.modes[currentMode] - + const modeColors = theme.modes[currentMode] + if (!modeColors.brand || !modeColors.brand[1]) { // Trigger a custom event that ColorPicker can listen to if (typeof window !== 'undefined') { diff --git a/docs/.vitepress/theme/themes/types.ts b/docs/.vitepress/theme/themes/types.ts index cc997412c..de54fa80a 100644 --- a/docs/.vitepress/theme/themes/types.ts +++ b/docs/.vitepress/theme/themes/types.ts @@ -130,5 +130,5 @@ export interface ThemeRegistry { export interface ThemeState { currentTheme: string currentMode: DisplayMode - theme: Theme + theme: Theme | null }