Skip to content

subscribeHostTheme

function subscribeHostTheme(cb): () => void;

Defined in: src/ui/theme.ts:180

Watch the host page for theme switches: class/attribute/style changes on <html> and <body>, plus the OS scheme. Returns the unsubscribe function. Without a DOM or MutationObserver (SSR, old test environments) it only follows the OS scheme.

Parameter Type
cb () => void

() => void