From f5572de605218d34209621fdc6ec340f0814a265 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Wed, 5 Aug 2026 19:00:27 +0200 Subject: [PATCH] fix(color-scheme): load color scheme initially The color scheme is now loaded and set after registering the watcher to ensure that the callback is also called initially. --- src/App.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 67a933a..369a3c4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -26,7 +26,7 @@ import { useRoute } from 'vue-router'; const route = useRoute(); const { getColorScheme, updateColorScheme } = useColorScheme(); -const colorScheme = ref(getColorScheme()); +const colorScheme = ref('auto'); provide('colorScheme', colorScheme); watch(colorScheme, (newValue) => { updateColorScheme(newValue); @@ -46,6 +46,7 @@ watch(colorScheme, (newValue) => { document.body.classList.remove('color-scheme-auto'); } }); +colorScheme.value = getColorScheme(); watchEffect(() => updatePageTitle(route));