θaddThemingController

Creates and attaches a ThemingController to the given host element.

This is the preferred way to add theming support to a component. The controller is registered with the host's reactive controller lifecycle and automatically resolves the active theme from an ancestor theme provider context or falls back to the application-wide theme set via configureTheme() .

Signature

θaddThemingController(host: ReactiveControllerHost & ReactiveElement, themes: ComponentThemes, config: ThemingControllerConfig): ThemingController

Parameters

  • host: ReactiveControllerHost & ReactiveElement

    The Lit element that will host the controller.

  • themes: ComponentThemes

    The theme styles map containing light and dark variant entries, each keyed by theme name (bootstrap, material, fluent, indigo) and an optional shared entry applied regardless of theme. An entry is one style sheet, or an array of them in cascade order.

  • config: ThemingControllerConfig

    Optional configuration.

Returns

ThemingController

The created ThemingController instance.