diff --git a/packages/uikit/src/dark.ts b/packages/uikit/src/dark.ts index 4c3e9f53..43105814 100644 --- a/packages/uikit/src/dark.ts +++ b/packages/uikit/src/dark.ts @@ -7,7 +7,7 @@ import { Color as ColorRepresentation } from '@react-three/fiber' export type WithPreferredColorScheme = { dark?: T } & T -const queryList = window.matchMedia?.('(prefers-color-scheme: dark)') +const queryList = typeof matchMedia === 'undefined' ? undefined : matchMedia?.('(prefers-color-scheme: dark)') const symstemIsDarkMode = signal(queryList?.matches ?? false)