element-plus/docs/.vitepress/vitepress/composables/dark.ts

13 lines
262 B
TypeScript
Raw Normal View History

import { useDark, useToggle } from '@vueuse/core'
export const isDark = useDark({
storageKey: 'el-theme-appearance',
})
// TODO: remove when dark mode is ready
if (!import.meta.env.DEV) {
isDark.value = false
}
export const toggleDark = useToggle(isDark)