From 3d65d9e84af9bd6c9f923b53be9be124ccba4007 Mon Sep 17 00:00:00 2001 From: Samidy Date: Thu, 2 Oct 2025 13:01:02 +0300 Subject: [PATCH] uhhuh --- .../theme/components/ColorPicker.vue | 41 +++++++++++++++ docs/.vitepress/theme/style.scss | 51 +++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/docs/.vitepress/theme/components/ColorPicker.vue b/docs/.vitepress/theme/components/ColorPicker.vue index 94675a309..0964726a9 100644 --- a/docs/.vitepress/theme/components/ColorPicker.vue +++ b/docs/.vitepress/theme/components/ColorPicker.vue @@ -54,6 +54,39 @@ const updateThemeColor = (colorName: ColorNames) => { .map((scale) => `--vp-c-brand-${scale}: ${colorSet[scale]};`) .join('\n ') + // if user isnt using halloween theme switch it + const nonHalloweenOverride = colorName !== 'halloween' ? ` + --vp-c-bg: rgb(26, 26, 26) !important; + --vp-c-bg-alt: rgb(23, 23, 23) !important; + --vp-c-bg-elv: rgba(23, 23, 23, 0.8) !important; + --vp-button-alt-bg: #484848 !important; + --vp-button-alt-text: #f0eeee !important; + --vp-button-alt-hover-bg: #484848 !important; + --vp-button-alt-hover-text: #f0eeee !important; + --vp-button-brand-bg: var(--vp-c-brand-1) !important; + --vp-button-brand-border: var(--vp-c-brand-soft) !important; + --vp-button-brand-text: rgba(42, 40, 47) !important; + --vp-button-brand-hover-bg: var(--vp-c-brand-soft) !important; + --vp-button-brand-hover-border: var(--vp-c-brand-soft) !important; + --vp-button-brand-hover-text: rgba(42, 40, 47) !important; + ` : '' + + const nonHalloweenDarkOverride = colorName !== 'halloween' ? ` + --vp-c-bg: rgb(26, 26, 26) !important; + --vp-c-bg-alt: rgb(23, 23, 23) !important; + --vp-c-bg-elv: rgba(23, 23, 23, 0.8) !important; + --vp-button-alt-bg: #484848 !important; + --vp-button-alt-text: #f0eeee !important; + --vp-button-alt-hover-bg: #484848 !important; + --vp-button-alt-hover-text: #f0eeee !important; + --vp-button-brand-bg: var(--vp-c-brand-1) !important; + --vp-button-brand-border: var(--vp-c-brand-soft) !important; + --vp-button-brand-text: rgba(42, 40, 47) !important; + --vp-button-brand-hover-bg: var(--vp-c-brand-soft) !important; + --vp-button-brand-hover-border: var(--vp-c-brand-soft) !important; + --vp-button-brand-hover-text: rgba(42, 40, 47) !important; + ` : '' + css.value = ` :root { ${cssVars} @@ -61,6 +94,7 @@ const updateThemeColor = (colorName: ColorNames) => { --vp-c-brand-2: ${colorSet[600]}; --vp-c-brand-3: ${colorSet[800]}; --vp-c-brand-soft: ${colorSet[400]}; + ${nonHalloweenOverride} } .dark { @@ -69,6 +103,7 @@ const updateThemeColor = (colorName: ColorNames) => { --vp-c-brand-2: ${colorSet[500]}; --vp-c-brand-3: ${colorSet[700]}; --vp-c-brand-soft: ${colorSet[300]}; + ${nonHalloweenDarkOverride} } ` @@ -81,6 +116,12 @@ const updateThemeColor = (colorName: ColorNames) => { } } +// Set Halloween theme ASAP if its the pref +const storedTheme = localStorage.getItem('preferred-color') +if (!storedTheme || storedTheme === '"halloween"') { + document.documentElement.setAttribute('data-halloween-theme', 'true') +} + // Initialize theme color updateThemeColor(selectedColor.value) diff --git a/docs/.vitepress/theme/style.scss b/docs/.vitepress/theme/style.scss index 513b0b7cf..2ae24f2f7 100644 --- a/docs/.vitepress/theme/style.scss +++ b/docs/.vitepress/theme/style.scss @@ -64,6 +64,57 @@ --vp-custom-block-halloween-text-deep: var(--halloween-900); } +/* Apply halloween theme by default */ +:root { + --vp-c-bg: rgb(20, 20, 20) !important; + --vp-c-bg-alt: rgb(18, 18, 18) !important; + --vp-c-bg-elv: rgba(18, 18, 18, 0.8) !important; + --vp-c-bg-soft: rgb(18, 18, 18) !important; + --vp-button-alt-bg: #a855f7 !important; + --vp-button-alt-text: #fff !important; + --vp-button-alt-hover-bg: #9333ea !important; + --vp-button-alt-hover-text: #fff !important; + --vp-button-brand-bg: #FF6A00 !important; + --vp-button-brand-border: #FF6A00 !important; + --vp-button-brand-text: #fff !important; + --vp-button-brand-hover-bg: #ea580c !important; + --vp-button-brand-hover-border: #ea580c !important; + --vp-button-brand-hover-text: #fff !important; +} + +body { + background-color: rgb(20, 20, 20) !important; +} + +.VPApp, .Layout, .VPContent, .VPHome, .VPHero, #app { + background-color: rgb(20, 20, 20) !important; +} + +.dark { + --vp-c-bg: rgb(15, 15, 15) !important; + --vp-c-bg-alt: rgb(12, 12, 12) !important; + --vp-c-bg-elv: rgba(12, 12, 12, 0.8) !important; + --vp-c-bg-soft: rgb(12, 12, 12) !important; + --vp-button-alt-bg: #8b5cf6 !important; + --vp-button-alt-text: #e9d5ff !important; + --vp-button-alt-hover-bg: #a855f7 !important; + --vp-button-alt-hover-text: #fff !important; + --vp-button-brand-bg: #FF6A00 !important; + --vp-button-brand-border: #FF6A00 !important; + --vp-button-brand-text: #fff !important; + --vp-button-brand-hover-bg: #ea580c !important; + --vp-button-brand-hover-border: #ea580c !important; + --vp-button-brand-hover-text: #fff !important; +} + +.dark body { + background-color: rgb(15, 15, 15) !important; +} + +.dark .VPApp, .dark .Layout, .dark .VPContent, .dark .VPHome, .dark .VPHero, .dark #app { + background-color: rgb(15, 15, 15) !important; +} + .dark { /* Colors: Brand */ --vp-c-brand-1: theme('colors.swarm.400');