1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Design tokens as data — colors, type, space, shadows, gradients, and contrast — rendered to CSS.
//!
//! `tangible` turns a structured token specification into a CSS custom-property sheet you can drop
//! into any project. It is the library that powers the `tangible` command-line tool, but every
//! step in the pipeline (parsing, resolving palettes, picking inks, emitting CSS) is available
//! programmatically for embedding in build scripts, generators, or design-system tooling.
//!
//! # At a glance
//!
//! ```no_run
//! use tangible::{Renderer, Spec};
//!
//! let json = std::fs::read_to_string("tokens.json")?;
//! let spec: Spec = serde_json::from_str(&json)?;
//! let manifest = Renderer::new().render(&spec)?;
//! std::fs::write("dist/tokens.css", manifest.to_string())?;
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! # Modules
//!
//! - [`color`] — color definitions, gradients, interpolation, sampling.
//! - [`contrast`] — WCAG-driven ink selection for legible text on arbitrary backgrounds.
//! - [`spec`] — the [`Spec`] structure and its sub-types (the input format).
//! - [`render`] — the [`Renderer`], its [`Config`], and the resulting [`Manifest`].
pub use crateError;
pub use crate;
pub use crateSpec;
/// A specialized [`Result`] type for `tangible` operations.
pub type Result<T> = Result;