File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 1
1
import siteData from '@siteData'
2
- import { useDark } from '@vueuse/core'
2
+ import { useDark , usePreferredDark } from '@vueuse/core'
3
3
import {
4
4
computed ,
5
5
inject ,
@@ -79,13 +79,15 @@ export function initData(route: Route): VitePressData {
79
79
const isDark =
80
80
appearance === 'force-dark'
81
81
? ref ( true )
82
- : appearance
83
- ? useDark ( {
84
- storageKey : APPEARANCE_KEY ,
85
- initialValue : ( ) => ( appearance === 'dark' ? 'dark' : 'auto' ) ,
86
- ...( typeof appearance === 'object' ? appearance : { } )
87
- } )
88
- : ref ( false )
82
+ : appearance === 'force-auto'
83
+ ? usePreferredDark ( )
84
+ : appearance
85
+ ? useDark ( {
86
+ storageKey : APPEARANCE_KEY ,
87
+ initialValue : ( ) => ( appearance === 'dark' ? 'dark' : 'auto' ) ,
88
+ ...( typeof appearance === 'object' ? appearance : { } )
89
+ } )
90
+ : ref ( false )
89
91
90
92
const hashRef = ref ( inBrowser ? location . hash : '' )
91
93
You can’t perform that action at this time.
0 commit comments