pull/4263/head
Mike Bostock 12 months ago
parent f8edd7c6b5
commit 9f6f373e73
No known key found for this signature in database
GPG Key ID: C6817CA4CDEC8FDB

@ -80,14 +80,14 @@ export function initData(route: Route): VitePressData {
appearance === 'force-dark' appearance === 'force-dark'
? ref(true) ? ref(true)
: appearance === 'force-auto' : appearance === 'force-auto'
? usePreferredDark() ? usePreferredDark()
: appearance : appearance
? useDark({ ? useDark({
storageKey: APPEARANCE_KEY, storageKey: APPEARANCE_KEY,
initialValue: () => (appearance === 'dark' ? 'dark' : 'auto'), initialValue: () => (appearance === 'dark' ? 'dark' : 'auto'),
...(typeof appearance === 'object' ? appearance : {}) ...(typeof appearance === 'object' ? appearance : {})
}) })
: ref(false) : ref(false)
const hashRef = ref(inBrowser ? location.hash : '') const hashRef = ref(inBrowser ? location.hash : '')

Loading…
Cancel
Save