Bandera.Dashboard.Theme (bandera v0.2.0)

Copy Markdown View Source

Maps a dashboard element's semantic role to a CSS class string for the active theme. The LiveView markup is identical across themes; only the class strings differ, so there is a single template and no fork.

  • :standalone (default) returns bandera--prefixed classes styled by the inlined stylesheet in Bandera.Dashboard.Components.styles/1.
  • :daisyui returns daisyUI component classes plus Tailwind layout utilities, styled by the host application's own asset build (which must include daisyUI and scan Bandera's templates).

Any theme other than :daisyui resolves to the standalone classes.

Summary

Functions

The CSS class string for role under theme.

Every semantic role the dashboard styles.

Types

role()

@type role() ::
  :wrap
  | :heading
  | :flash
  | :search
  | :group
  | :group_summary
  | :count
  | :row
  | :name
  | :editor
  | :fieldset
  | :legend
  | :gate_list
  | :gate_item
  | :input
  | :select
  | :primary_button
  | :neutral_button
  | :danger_button
  | :icon_button
  | :toggle_on
  | :toggle_off
  | :summary

theme()

@type theme() :: :standalone | :daisyui

Functions

class(arg1, role)

@spec class(theme(), role()) :: String.t()

The CSS class string for role under theme.

roles()

@spec roles() :: [role()]

Every semantic role the dashboard styles.