PhoenixKit.ThemeConfig (phoenix_kit v1.7.69)

Copy Markdown View Source

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.

Functions

all_theme_names()

Returns all theme names recognised by PhoenixKit.

base_map()

Returns a map of theme names to their base variant ("light" or "dark").

custom_theme_css()

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.

custom_theme_variables()

Returns the raw custom theme variable map.

default_html_theme()

Returns the initial theme applied to the <html> element on first render.

default_theme()

Returns the logical default theme name stored in the user's preferences.

get_theme()

Fetches the current theme (alias for default_theme/0).

label_map()

Returns a map of theme names to user-facing labels.

modern_css_variables()

Returns modern CSS variables for the theme system.

Currently unused but kept for backwards compatibility with previous helper implementations.

slider_primary_map()

Returns the theme slot metadata used by slider buttons.

slider_primary_theme(group)

Returns the canonical theme dispatched when a slider button is pressed.

slider_target_map()

Returns the slider target configuration map with string keys. Suitable for encoding to JSON for client-side usage.

slider_targets(group)

Returns the list of target aliases used by the slider buttons for the given group ("system", "light", or "dark").

theme_data_attributes()

Returns theme data attributes for HTML elements.