MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getSystemColorScheme

Function getSystemColorScheme

packages/dev/s2-docs/src/SettingsProvider.tsx:20–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18}
19
20function getSystemColorScheme(): ColorScheme {
21 return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
22}
23
24function getServerSnapshot(): ColorScheme {
25 return 'light';

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected