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

Function applyTheme

webapp/_webapp/src/hooks/useThemeSync.ts:17–24  ·  view source on GitHub ↗
(isDark: boolean)

Source from the content-addressed store, hash-verified

15}
16
17function applyTheme(isDark: boolean): void {
18 const roots = SCOPE_ROOT_IDS.map((id) => document.getElementById(id)).filter((el): el is HTMLElement => !!el);
19 if (roots.length === 0) {
20 applyThemeToElement(document.documentElement, isDark);
21 return;
22 }
23 for (const root of roots) applyThemeToElement(root, isDark);
24}
25
26export function useThemeSync(): void {
27 const themeMode = useSettingStore((s) => s.themeMode);

Callers 2

useThemeSyncFunction · 0.85
updateFunction · 0.85

Calls 1

applyThemeToElementFunction · 0.85

Tested by

no test coverage detected