Raxol.Style (Raxol v0.2.0)

View Source

Defines style properties for terminal UI elements.

Summary

Functions

Apply component-specific styling.

Apply responsive styling based on terminal dimensions.

Merges two styles, with the second overriding the first.

Creates a new style with default values.

Creates a new style from a keyword list or map of attributes.

Resolves a style definition against the current theme.

Converts style properties to ANSI escape sequences (currently just numeric codes).

Types

t()

@type t() :: %Raxol.Style{
  background: Raxol.Style.Colors.Color.t() | nil,
  border: Raxol.Style.Borders.t(),
  color: Raxol.Style.Colors.Color.t() | nil,
  decorations: [atom()],
  layout: Raxol.Style.Layout.t(),
  text_decoration: [:underline | :strikethrough | :bold | :italic]
}

Functions

apply_component_specific(style, component_type)

Apply component-specific styling.

apply_responsive(style, width, height)

Apply responsive styling based on terminal dimensions.

merge(base, override)

Merges two styles, with the second overriding the first.

new()

Creates a new style with default values.

new(attrs)

Creates a new style from a keyword list or map of attributes.

resolve(style_def, theme \\ nil)

Resolves a style definition against the current theme.

to_ansi(style)

Converts style properties to ANSI escape sequences (currently just numeric codes).