Skip to main content

Crate arama_theme

Crate arama_theme 

Source
Expand description

§arama-theme

Token-driven styling for arama, backed by the Snora Design system (RFC 010) with a runtime-selectable theme preset (RFC 011).

§Three styling layers

A theme switch must move three layers together:

  • A — Snora button tokens. The four button style functions below (primary, ghost, secondary, danger) resolve the active snora::design::Tokens from the current preset.
  • B — Snora container tokens. Reserved for future card surfaces; driven by the same [tokens].
  • C — Base iced theme. iced_theme returns the matching iced Theme for the application’s .theme() callback, so the window background and all stock iced widgets track the preset.

§Global state

The active preset is stored in a global AtomicU8 — the same lock-free pattern arama uses for the i18n locale — so set_theme and the lookup functions are safe to call from any thread without lifetime friction in view().

Functions§

current_theme
Return the currently active theme preset.
danger
Danger button style — destructive actions such as “Stop”.
ghost
Ghost (transparent) button style — token-driven equivalent of iced’s button::text, used for inactive navigation items.
iced_theme
The base iced Theme for the active preset (layer C).
primary
Primary (accent) button style — active navigation item, confirmations.
secondary
Secondary button style — non-primary actions such as “Skip”.
set_theme
Set the active theme preset. Safe to call from any thread.