Raxol. UI. Theming. Theme
(Raxol v2.8.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: the one last applied (apply_theme/1,
Raxol.set_theme/1), else the theme registered under the default id,
else the built-in default_theme/0.
Returns the dark theme.
Returns the default theme.
Gets a theme by ID.
Gets a value from the theme using a path.
Gets a color from the theme, respecting variants and accessibility settings.
Gets a component style from the theme.
Creates a child theme that inherits from a parent theme.
Initializes the theme system and registers the default theme. This should be called during application startup.
Lists all available themes.
Merges two themes, with the second theme overriding values from the first.
Creates a new theme with the given attributes.
Registers a theme in the application environment.
Types
@type color_value() :: Raxol.Style.Colors.Color.t() | atom() | String.t()
@type t() :: %Raxol.UI.Theming.Theme{ colors: map() | nil, component_styles: map() | nil, dark_mode: boolean() | nil, description: String.t() | nil, fonts: map() | nil, high_contrast: term(), id: String.t() | nil, metadata: map() | nil, name: String.t() | nil, styles: map() | nil, ui_mappings: map() | nil, variants: map() | nil }
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.
A name must be the id of a registered theme (or :default); any other
name returns {:error, :theme_not_found} and leaves the current theme
unchanged.
Creates a high contrast variant of the theme.
Colours without RGB components (named colours such as :green, 256-colour
indexes, the {:error, :invalid_hex} of a bad hex string) are kept as they
are.
Returns the current theme: the one last applied (apply_theme/1,
Raxol.set_theme/1), else the theme registered under the default id,
else the built-in default_theme/0.
Returns the dark theme.
Returns the default theme.
Gets a theme by ID.
Gets a value from the theme using a path.
Gets a color from the theme, respecting variants and accessibility settings.
Gets a component style from the theme.
Creates a child theme that inherits from a parent theme.
Initializes the theme system and registers the default theme. This should be called during application startup.
Lists all available themes.
Merges two themes, with the second theme overriding values from the first.
Creates a new theme with the given attributes.
Registers a theme in the application environment.