|
|
@ -1,5 +1,5 @@
|
|
|
|
import siteData from '@siteData'
|
|
|
|
import siteData from '@siteData'
|
|
|
|
import { useDark } from '@vueuse/core'
|
|
|
|
import { useDark, usePreferredDark } from '@vueuse/core'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
computed,
|
|
|
|
computed,
|
|
|
|
inject,
|
|
|
|
inject,
|
|
|
@ -79,13 +79,15 @@ export function initData(route: Route): VitePressData {
|
|
|
|
const isDark =
|
|
|
|
const isDark =
|
|
|
|
appearance === 'force-dark'
|
|
|
|
appearance === 'force-dark'
|
|
|
|
? ref(true)
|
|
|
|
? ref(true)
|
|
|
|
: appearance
|
|
|
|
: appearance === 'force-auto'
|
|
|
|
? useDark({
|
|
|
|
? usePreferredDark()
|
|
|
|
storageKey: APPEARANCE_KEY,
|
|
|
|
: appearance
|
|
|
|
initialValue: () => (appearance === 'dark' ? 'dark' : 'auto'),
|
|
|
|
? useDark({
|
|
|
|
...(typeof appearance === 'object' ? appearance : {})
|
|
|
|
storageKey: APPEARANCE_KEY,
|
|
|
|
})
|
|
|
|
initialValue: () => (appearance === 'dark' ? 'dark' : 'auto'),
|
|
|
|
: ref(false)
|
|
|
|
...(typeof appearance === 'object' ? appearance : {})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
: ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
const hashRef = ref(inBrowser ? location.hash : '')
|
|
|
|
const hashRef = ref(inBrowser ? location.hash : '')
|
|
|
|
|
|
|
|
|
|
|
|