MCPcopy Create free account
hub / github.com/chokcoco/iCSS / getSystemTheme

Function getSystemTheme

website/app/lib/theme.ts:27–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25];
26
27export function getSystemTheme(): 'light' | 'dark' {
28 if (typeof window === 'undefined') return 'light';
29 return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
30}
31
32export function applyTheme(theme: Theme) {
33 if (typeof window === 'undefined') return;

Callers 1

applyThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected