File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,9 @@ function noTransition() {
4646
4747let defaultTheme: string | undefined
4848watch (() => props .forceDark , () => {
49- if (inBrowser && props .forceDark ) {
49+ if (! inBrowser || __VUEPRESS_SSR__ )
50+ return
51+ if (props .forceDark ) {
5052 defaultTheme ?? = document .documentElement .dataset .theme
5153 document .documentElement .dataset .theme = ' dark'
5254 document .documentElement .classList .add (' force-dark' )
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export function useCssVar(
1515
1616 function updateCssVar ( ) {
1717 const _window = typeof window ? window : null
18- const target = _window ?. document . documentElement
18+ const target = _window ?. document ? .documentElement
1919 const key = toValue ( prop )
2020 if ( target && key ) {
2121 const value = _window . getComputedStyle ( target ) . getPropertyValue ( key ) ?. trim ( )
You can’t perform that action at this time.
0 commit comments