Raxol.UI.Theming.Theme (Raxol v0.5.0)

View Source

Theme management for Raxol UI components.

This module provides functionality for:

  • Theme definition and management
  • Color palette integration
  • Component styling
  • Theme variants and accessibility

Summary

Functions

Returns a high-contrast version of the given theme, for accessibility support. If the theme is already high-contrast, returns it unchanged.

Applies a theme by name or struct.

Creates a high contrast variant of the theme.

Returns the current theme.

Returns the dark theme.

Returns the default theme.

Gets a theme by ID.

Gets a color from the theme, respecting variants and accessibility settings.

Gets a component style from the theme.

Initializes the theme system and registers the default theme. This should be called during application startup.

Lists all available themes.

Creates a new theme with the given attributes.

Registers a theme in the application environment.

Types

color_value()

@type color_value() :: Raxol.Style.Colors.Color.t() | atom() | String.t()

style_map()

@type style_map() :: %{required(atom()) => any()}

Functions

adjust_for_high_contrast(theme)

Returns a high-contrast version of the given theme, for accessibility support. If the theme is already high-contrast, returns it unchanged.

apply_theme(theme)

Applies a theme by name or struct.

component_style(theme, component_type)

create_high_contrast_variant(theme)

Creates a high contrast variant of the theme.

current()

Returns the current theme.

dark_theme()

Returns the dark theme.

default_theme()

Returns the default theme.

default_theme_id()

get(theme_id)

Gets a theme by ID.

get_color(theme, color_name, arg3 \\ nil)

Gets a color from the theme, respecting variants and accessibility settings.

get_component_style(theme, component_type)

Gets a component style from the theme.

init()

Initializes the theme system and registers the default theme. This should be called during application startup.

list_themes()

Lists all available themes.

new()

Creates a new theme with the given attributes.

new(attrs)

register(theme)

Registers a theme in the application environment.