diff --git a/resources/scripts/components/LightDarkSwitcher.vue b/resources/scripts/components/LightDarkSwitcher.vue index 8273eb79..9a1fff39 100644 --- a/resources/scripts/components/LightDarkSwitcher.vue +++ b/resources/scripts/components/LightDarkSwitcher.vue @@ -16,6 +16,13 @@ defineProps({ const globalStore = useGlobalStore() +const isDark = ref( + localStorage.getItem('theme') === 'dark' + || document.documentElement.classList.contains('dark'), +) + +globalStore.isDarkModeOn = isDark + const enabled = computed({ get: () => globalStore.isDarkModeOn, set: (value) => {