element-plus/docs/.vitepress/vitepress/composables/dark.ts
云游君 c3b935d803
fix(docs): do not useDark when production (#6262)
* fix(theme-chalk): remove useless tag close icon css attribute

* fix(docs): disable useDark when online
2022-02-24 14:03:02 +08:00

11 lines
308 B
TypeScript

import { useDark, useToggle } from '@vueuse/core'
export const isDark =
// @ts-expect-error when PROD is true, do not useDark
import.meta.env.PROD ||
useDark({
storageKey: 'el-theme-appearance',
})
// remove as boolean when dark mode is ok
export const toggleDark = useToggle(isDark as boolean)