MCPcopy Create free account
hub / github.com/code-forge-io/react-router-devtools / getSystemTheme

Function getSystemTheme

docs/app/utils/theme.ts:3–6  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { THEME, setStorageItem } from "./local-storage"
2
3export function getSystemTheme(): "light" | "dark" {
4 if (typeof window === "undefined") return "light"
5 return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"
6}
7
8export function getCurrentTheme(): "light" | "dark" {
9 if (typeof document === "undefined") return "light"

Callers 1

LayoutFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…