Raxol.UI.StyleProcessor (Raxol v2.0.1)

View Source

Handles style processing, merging, inheritance, and flattening.

Supports optional caching for performance-critical applications.

Configuration

Set caching mode in application config:

config :raxol, :style_processor,
  cache_enabled: true

Or control per-call with options:

StyleProcessor.flatten_merged_style(parent, child, theme, cache: true)

Migration from StyleProcessorCached

Replace:

Raxol.UI.StyleProcessorCached.flatten_merged_style(parent, child, theme)

With:

Raxol.UI.StyleProcessor.flatten_merged_style(parent, child, theme, cache: true)

Summary

Functions

Clear all style processing caches.

Ensures a value is a list.

Flattens and merges styles from parent style and child element with proper theme resolution.

Merges parent and child styles for inheritance.

Functions

clear_cache()

Clear all style processing caches.

ensure_list(value)

Ensures a value is a list.

flatten_merged_style(parent_style, child_element, theme, opts \\ [])

Flattens and merges styles from parent style and child element with proper theme resolution.

Options

  • cache: boolean() - Enable caching for this operation (default: false)

inherit_colors(child_style_map, parent_element, parent_style_map, opts \\ [])

Inherits colors from parent to child style.

Options

  • cache: boolean() - Enable caching for this operation (default: false)

merge_styles_for_inheritance(parent_style, child_style, opts \\ [])

Merges parent and child styles for inheritance.

Options

  • cache: boolean() - Enable caching for this operation (default: false)