From 3c9169f97f8e5e4fa767758cca93d5f6c6d213c0 Mon Sep 17 00:00:00 2001 From: Samidy Date: Thu, 2 Oct 2025 11:56:14 +0300 Subject: [PATCH] background change for halloween --- docs/.vitepress/theme/components/ColorPicker.vue | 8 ++++++++ docs/.vitepress/theme/style.scss | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/docs/.vitepress/theme/components/ColorPicker.vue b/docs/.vitepress/theme/components/ColorPicker.vue index e4a9ba54c..b4965a026 100644 --- a/docs/.vitepress/theme/components/ColorPicker.vue +++ b/docs/.vitepress/theme/components/ColorPicker.vue @@ -71,6 +71,14 @@ const updateThemeColor = (colorName: ColorNames) => { --vp-c-brand-soft: ${colorSet[300]}; } ` + + // Add/remove Halloween theme indicator + const htmlElement = document.documentElement + if (colorName === 'halloween') { + htmlElement.setAttribute('data-halloween-theme', 'true') + } else { + htmlElement.removeAttribute('data-halloween-theme') + } } // Initialize theme color diff --git a/docs/.vitepress/theme/style.scss b/docs/.vitepress/theme/style.scss index 94b57448d..4b275f93a 100644 --- a/docs/.vitepress/theme/style.scss +++ b/docs/.vitepress/theme/style.scss @@ -104,6 +104,17 @@ --vp-custom-block-halloween-text-deep: var(--halloween-200); } +/* Halloween theme background override */ +:root:has([data-halloween-theme]) { + --vp-c-bg: rgb(20, 20, 20); + --vp-c-bg-alt: rgb(18, 18, 18); +} + +.dark:has([data-halloween-theme]) { + --vp-c-bg: rgb(18, 18, 18); + --vp-c-bg-alt: rgb(15, 15, 15); +} + .vp-doc a { color: var(--vp-c-brand-1); text-decoration: underline;