App-scoped theme metadata and semantic tokens.
Themes are plain Elixir data. They validate semantic color tokens and resolve style definitions to canonical primitive IR style tuples before native render.
Summary
Functions
Looks up a semantic color token in a validated theme.
Returns a theme color reference for use inside theme style definitions.
Returns one of Guppy's built-in default themes.
Returns a validated theme refined from an existing theme and override data.
Looks up a resolved semantic style token in a validated theme.
Types
@type appearance() :: :light | :dark | :system
@type color_role() ::
:bg
| :text_color
| :text_bg
| :border_color
| :text_decoration_color
| :strikethrough_color
@type t() :: %Guppy.App.Theme{ appearance: appearance(), colors: %{optional(String.t()) => color_value()}, id: String.t(), metadata: map(), name: String.t(), styles: %{optional(String.t()) => list()} }
Functions
@spec color(t(), atom() | String.t()) :: {:ok, color_value()} | {:error, term()}
Looks up a semantic color token in a validated theme.
@spec color_ref(color_role(), atom() | String.t()) :: {:theme_color, color_role(), atom() | String.t()}
Returns a theme color reference for use inside theme style definitions.
@spec default(:dark | :light) :: t()
Returns one of Guppy's built-in default themes.
Returns a validated theme refined from an existing theme and override data.
Looks up a resolved semantic style token in a validated theme.