Raxol.UI.Layout.StyleInheritance (Raxol v2.6.0)

View Source

Shared style inheritance logic for layout containers.

Text styling properties cascade from parent to child elements. Layout properties (padding, border, width, height, gap) do NOT inherit.

Summary

Functions

Converts style values to a map. Handles maps, keyword-like lists, and atoms.

Propagates inheritable style properties from a parent element into each child's style map. Child values take precedence.

Functions

ensure_style_map(style)

@spec ensure_style_map(term()) :: map()

Converts style values to a map. Handles maps, keyword-like lists, and atoms.

inherit_styles(parent, children)

@spec inherit_styles(map(), [map()]) :: [map()]

Propagates inheritable style properties from a parent element into each child's style map. Child values take precedence.