Skip to main content

zest_theme/
lib.rs

1//! Theme types for the `zest` GUI framework.
2//!
3//! Mirrors libcosmic's grouped structure:
4//!
5//! - [`Container<C>`] holds colors for a region (background, foreground,
6//!   divider) — used for [`Theme::background`], [`Theme::primary`],
7//!   [`Theme::secondary`].
8//! - [`Component<C>`] holds the four-state colors for an interactive
9//!   element (base, hovered, pressed, focused) plus a foreground color
10//!   for content drawn on top — used for [`Theme::accent`],
11//!   [`Theme::button`], [`Theme::destructive`], etc.
12//! - [`Palette<C>`] holds the named primitive colors (neutral_0 through
13//!   neutral_10, accent_blue, etc.) the theme is derived from.
14//! - [`Spacing`] holds the design-system spacing scale (space_xs through
15//!   space_xxxl).
16//! - [`CornerRadii`] holds the corner-radius scale (radius_xs through
17//!   radius_xl).
18//!
19//! `Theme<'a, C>` is generic over a
20//! [`embedded_graphics::pixelcolor::PixelColor`] and a lifetime for
21//! font references (which are typically `&'static MonoFont<'static>`).
22
23#![cfg_attr(not(test), no_std)]
24#![warn(missing_docs)]
25
26pub mod component;
27pub mod container;
28pub mod convert;
29pub mod corner_radii;
30pub mod font;
31pub mod palette;
32pub mod spacing;
33pub mod style;
34pub mod theme;
35pub mod typography;
36
37pub use component::Component;
38pub use container::Container;
39pub use convert::convert_theme;
40pub use corner_radii::CornerRadii;
41pub use font::{
42    FONT_ZEST_MONO, FONT_ZEST_MONO_CAPTION, FONT_ZEST_MONO_DISPLAY, FONT_ZEST_MONO_HEADING,
43};
44pub use palette::Palette;
45pub use spacing::Spacing;
46pub use style::{ButtonAppearance, ButtonCatalog, ButtonClass, Status};
47pub use theme::Theme;
48pub use typography::Typography;