fix(theme): improve force-dark in development (#450)
This commit is contained in:
parent
c703b89e1c
commit
149d31818f
@ -43,6 +43,10 @@ export function setupDarkMode(app: App): void {
|
||||
|
||||
app.provide(darkModeSymbol, isDark)
|
||||
|
||||
if (__VUEPRESS_DEV__ && appearance === 'force-dark' && typeof document !== 'undefined') {
|
||||
document.documentElement.dataset.theme = 'dark'
|
||||
}
|
||||
|
||||
Object.defineProperty(app.config.globalProperties, '$isDark', {
|
||||
get: () => isDark,
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user