MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / applyMode

Function applyMode

packages/app-core/src/components/OnboardingWizard.tsx:559–567  ·  view source on GitHub ↗
(mode: ThemeMode)

Source from the content-addressed store, hash-verified

557 }
558
559 const applyMode = (mode: ThemeMode): void => {
560 const prefersDark =
561 mode === 'dark' ||
562 (mode === 'auto' &&
563 typeof window !== 'undefined' &&
564 window.matchMedia('(prefers-color-scheme: dark)').matches)
565 const id = resolveAuto(themeFamily, prefersDark, themeId)
566 setTheme({ id, family: themeFamily, mode })
567 }
568
569 // Some families ship multiple flavors of the same mode (Gruvbox hard/medium/
570 // soft, GitHub default/dimmed/high-contrast, Catppuccin frappe/macchiato/

Callers 1

ThemeStepFunction · 0.85

Calls 1

resolveAutoFunction · 0.90

Tested by

no test coverage detected