MCPcopy
hub / github.com/primer/react / matchesMediaToColorMode

Function matchesMediaToColorMode

packages/react/src/ThemeProvider.tsx:165–167  ·  view source on GitHub ↗
(matches: boolean)

Source from the content-addressed store, hash-verified

163 const media = window?.matchMedia?.('(prefers-color-scheme: dark)')
164
165 function matchesMediaToColorMode(matches: boolean) {
166 return matches ? 'night' : 'day'
167 }
168
169 function handleChange(event: MediaQueryListEvent) {
170 const isNight = event.matches

Callers 2

handleChangeFunction · 0.85
useSystemColorModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected