MCPcopy Create free account
hub / github.com/PaperDebugger/paperdebugger / applyThemeToElement

Function applyThemeToElement

webapp/_webapp/src/hooks/useThemeSync.ts:9–15  ·  view source on GitHub ↗
(el: HTMLElement, isDark: boolean)

Source from the content-addressed store, hash-verified

7const SCOPE_ROOT_IDS = ["paper-debugger-root", "pd-portal", "pd-embed-sidebar"];
8
9function applyThemeToElement(el: HTMLElement, isDark: boolean): void {
10 if (isDark) {
11 el.classList.add("dark");
12 } else {
13 el.classList.remove("dark");
14 }
15}
16
17function applyTheme(isDark: boolean): void {
18 const roots = SCOPE_ROOT_IDS.map((id) => document.getElementById(id)).filter((el): el is HTMLElement => !!el);

Callers 1

applyThemeFunction · 0.85

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected