PhoenixFilament.Components.Theme (PhoenixFilament v0.1.0)

Copy Markdown View Source

Theme utilities for daisyUI 5 CSS variable theming.

Summary

Functions

Renders a daisyUI swap toggle that switches between light and dark themes via theme-controller.

Functions

css_vars(colors)

@spec css_vars(keyword()) :: String.t()

theme_attr(theme)

@spec theme_attr(atom() | String.t()) :: String.t()

theme_switcher(assigns)

Renders a daisyUI swap toggle that switches between light and dark themes via theme-controller.

Example

<.theme_switcher light_theme="light" dark_theme="dark" />

Attributes

  • light_theme (:string) - Defaults to "light".
  • dark_theme (:string) - Defaults to "dark".
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.