fix(theme): incorrect ssr in dark-mode

This commit is contained in:
pengzhanbo 2024-11-10 00:32:21 +08:00
parent b97b7f2e5f
commit bbef6a8f18

View File

@ -10,6 +10,8 @@ export const darkModeSymbol: InjectionKey<DarkModeRef> = Symbol(
)
export function enableTransitions() {
if (typeof document === 'undefined')
return false
return 'startViewTransition' in document
&& window.matchMedia('(prefers-reduced-motion: no-preference)').matches
}