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

Function getCurrentTheme

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

Source from the content-addressed store, hash-verified

6}
7
8export function getCurrentTheme(): "light" | "dark" {
9 if (typeof document === "undefined") return "light"
10 const theme = document.documentElement.getAttribute("data-theme")
11 return theme === "dark" ? "dark" : "light"
12}
13
14export function applyTheme(theme: "light" | "dark") {
15 document.documentElement.setAttribute("data-theme", theme)

Callers 1

ThemeToggleFunction · 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…