rio_theme/lib.rs
1//! Theme engine for `rustio-admin`.
2//!
3//! The crate takes a client's raw brand color(s) as input and emits
4//! a safe, computed `tokens.css` as output. The pipeline measures,
5//! repairs, derives, and adapts the raw input — the color a client
6//! hands you is *not* the color the UI ends up using.
7//!
8//! Build-time only: the engine runs inside `rustio-admin-cli` when a
9//! developer calls `rustio theme generate`. Runtime CSS is the
10//! generated static file; the runtime library never depends on this
11//! crate.
12//!
13//! Read order: `color` → `contrast` → the six decision cases
14//! (`guard`, `derive`, `vivid`, `semantic`, `adaptive`, `hierarchy`)
15//! → `engine` (the orchestrator) → `emit` (CSS serialisation).
16
17pub mod adaptive;
18pub mod color;
19pub mod contrast;
20pub mod derive;
21pub mod emit;
22pub mod engine;
23pub mod guard;
24pub mod hierarchy;
25pub mod semantic;
26pub mod vivid;
27
28pub use color::{Color, ColorError};
29pub use engine::{
30 resolve_theme, resolve_theme_with_report, ResolveReport, ThemeInput, ThemeTokens,
31};