Skip to main content

Module theme

Module theme 

Source
Expand description

Theme: the aggregate design-token bundle an app wires through to its widget tree. The value is delivered two ways: to app code through the reactive context (use_context::<Theme>() via the facade), and to widgets through the type-erased PaintCtx/LayoutCtx theme slot — the Theme::from_paint_ctx/Theme::from_layout_ctx wrappers below recover it in one line.

Structs§

Theme
A full design-token bundle: paired light/dark color schemes, the type scale, shape scale, elevation table, and motion scheme, plus which brightness is currently active.

Enums§

DesignLanguage
Which design language assembled a Theme — a Theme itself stays a single, language-agnostic aggregate struct; this is just a tag app/shell code can branch on (e.g. to pick per-platform interaction affordances), not a second Theme type. No constructor in this crate produces anything but the derived default: a design system sets its own tag through ThemeBuilder::design_language while assembling its baseline, from its own crate.