MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / getInitialTheme

Function getInitialTheme

dashboard/shell/src/main.jsx:66–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64// ---------------------------------------------------------------------------
65
66function getInitialTheme() {
67 try {
68 const stored =
69 localStorage.getItem("td-theme") ?? localStorage.getItem("ts-theme");
70 if (stored === "light" || stored === "dark") return stored;
71 } catch {
72 /* storage unavailable */
73 }
74 return window.matchMedia?.("(prefers-color-scheme: light)").matches ? "light" : "dark";
75}
76
77function applyTheme(theme) {
78 document.documentElement.setAttribute("data-theme", theme);

Callers 1

main.jsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected