Skip to content

Commit

Permalink
fix: ReferenceError: window is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohlender committed Feb 29, 2024
1 parent 5eb3479 commit 4d7fe4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/uikit/src/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Color as ColorRepresentation } from '@react-three/fiber'

export type WithPreferredColorScheme<T> = { 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)

Expand Down

0 comments on commit 4d7fe4f

Please sign in to comment.