🐛 Fix colorscheme

This commit is contained in:
2025-09-20 19:08:41 +08:00
parent 38295124cb
commit b4c105b43e
6 changed files with 113 additions and 42 deletions

View File

@@ -1,22 +0,0 @@
import { useDark, useToggle } from "@vueuse/core"
// composables/useCustomTheme.ts
export function useCustomTheme(): {
isDark: WritableComputedRef<boolean, boolean>
toggle: (value?: boolean | undefined) => boolean,
} {
const { $vuetify } = useNuxtApp()
const isDark = useDark({
valueDark: "dark",
valueLight: "light",
initialValue: "light",
onChanged: (dark: boolean) => {
$vuetify.theme.change(dark ? "dark" : "light")
}
})
const toggle = useToggle(isDark)
return { isDark, toggle }
}