Expand description
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
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())?;§Modules
Re-exports§
pub use crate::error::Error;pub use crate::render::Config;pub use crate::render::Manifest;pub use crate::render::Renderer;pub use crate::spec::Spec;
Modules§
- cli
- Command-line interface, gated behind the
clifeature. - color
- Color definitions, gradients, and sampling.
- contrast
- WCAG contrast computation and ink selection.
- error
- The crate-wide error type.
- io
- Filesystem boundary for
tangible’s CLI layer. - render
- Rendering a
Specinto a CSSManifest. - spec
- The token specification — what
tangibleconsumes.