Theme configuration utilities for PhoenixKit's DaisyUI integration.
This module centralises the theme metadata used across the admin UI so that PhoenixKit and the consuming application stay in sync. Updating or adding a theme requires changing this module and the shared CSS asset only.
Summary
Functions
Returns all theme names recognised by PhoenixKit.
Returns a map of theme names to their base variant ("light" or "dark").
Returns the custom PhoenixKit theme definitions as a CSS string.
Returns the raw custom theme variable map.
Returns the initial theme applied to the <html> element on first render.
Returns the logical default theme name stored in the user's preferences.
Returns the ordered list of themes displayed in dropdown selectors.
Fetches the current theme (alias for default_theme/0).
Returns a map of theme names to user-facing labels.
Returns modern CSS variables for the theme system.
Returns the theme slot metadata used by slider buttons.
Returns the canonical theme dispatched when a slider button is pressed.
Returns the slider target configuration map with string keys. Suitable for encoding to JSON for client-side usage.
Returns the list of target aliases used by the slider buttons for the given
group ("system", "light", or "dark").
Returns theme data attributes for HTML elements.
Returns the translated, user-facing label for a theme key.
Returns a map of theme names to translated, user-facing labels.
Functions
Returns all theme names recognised by PhoenixKit.
Returns a map of theme names to their base variant ("light" or "dark").
Returns the custom PhoenixKit theme definitions as a CSS string.
Only custom PhoenixKit themes are included here; DaisyUI-built themes are shipped with the DaisyUI plugin.
Returns the raw custom theme variable map.
Returns the initial theme applied to the <html> element on first render.
Returns the logical default theme name stored in the user's preferences.
Returns the ordered list of themes displayed in dropdown selectors.
Options
:allornil- Returns all themes (default)- List of theme names - Returns only the specified themes in order
Examples
# All themes
dropdown_themes()
dropdown_themes(:all)
# Only specific themes
dropdown_themes(["system", "light", "dark", "nord", "dracula"])
Fetches the current theme (alias for default_theme/0).
Returns a map of theme names to user-facing labels.
Returns modern CSS variables for the theme system.
Currently unused but kept for backwards compatibility with previous helper implementations.
Returns the theme slot metadata used by slider buttons.
Returns the canonical theme dispatched when a slider button is pressed.
Returns the slider target configuration map with string keys. Suitable for encoding to JSON for client-side usage.
Returns the list of target aliases used by the slider buttons for the given
group ("system", "light", or "dark").
Returns theme data attributes for HTML elements.
Returns the translated, user-facing label for a theme key.
@labels is a compile-time module attribute, so it can't hold macro-expanded
gettext/1 calls directly — this function is the translated counterpart,
with one literal gettext/1 call per theme so mix gettext.extract can
find them.
Returns a map of theme names to translated, user-facing labels.
Same shape as label_map/0 but locale-aware — use this (not
label_map/0) for anything rendered to a user, including client-side JS
embeds built from a JSON-encoded map.