Raxol.UI.Theming.Theme (Raxol v0.3.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.

Creates a high contrast variant of the theme.

Returns the currently active theme. Defaults to :default if not set.

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 the component style for a specific component type.

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

Lists all registered themes as a list of theme structs.

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.

component_style(theme, component_type)

create_high_contrast_variant(theme)

Creates a high contrast variant of the theme.

current()

Returns the currently active theme. Defaults to :default if not set.

dark_theme()

Returns the dark theme.

default_theme()

Returns the default theme.

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 the component style for a specific component type.

init()

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

list_themes()

Lists all registered themes as a list of theme structs.

new(attrs \\ %{})

Creates a new theme with the given attributes.

register(theme)

Registers a theme in the application environment.