Skip to content

esmevane/tangible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tangible

Design tokens as data — colors, type, space, shadows, gradients, and contrast — rendered to CSS.

A library and command-line tool for turning a structured design-token specification (JSON, or any serde-compatible format) into a CSS custom-property sheet you can drop into any project.

Themes

Five sample themes, each rendered from a single JSON spec. Source specs and sample HTML are in samples/.

Prose

Editorial light · Literata · blue + amber on warm neutrals

prose

Starliner

Sleek dark · Sora · violet + emerald

starliner

Tropical

Vivid · Bricolage Grotesque · coral + teal

tropical

Candy

Sweet light · Caprasimo · pink + lime on cream

candy

Cosmic

Deep space · Audiowide · magenta + cyan on ink

cosmic

At a glance

# Install (once published)
cargo install tangible

# Render a spec file to CSS on stdout
tangible tokens.json

# Or to a file
tangible tokens.json -o dist/tokens.css
use tangible::{Renderer, Spec};

let spec: Spec = serde_json::from_str(json)?;
let css = Renderer::new().render(&spec)?;
std::fs::write("dist/tokens.css", css.to_string())?;

What it generates

From a single spec file, tangible emits CSS custom properties for:

  • Palettes — explicit hex lists or interpolated gradients (linear / catmull-rom / basis, blended in rgb / linear-rgb / oklab / lab).
  • Semantic aliases — name your roles (bg, surface, interactive) and bind them to palette shades or raw values.
  • Ink (contrast) — for every semantic color, tangible picks the higher-contrast ink (WCAG luminance) and emits both the ink color and a paired text-shadow.
  • Typography — font families, sizes, weights, line-heights, letter-spacings.
  • Space and dimensions — scale-aligned spacing and sizing tokens.
  • Borders — radii and widths.
  • Shadows and glows — multi-layer drop shadows and elevation glows.
  • Gradients — both var-reference and pre-resolved (color-space-interpolated) gradient strings.
  • Transitions, z-index, opacity, overlay — the remaining variables.

Library or CLI

The cli feature is enabled by default. To use tangible as a library only:

[dependencies]
tangible = { version = "0.0.1", default-features = false }

License

Dual-licensed under either of

at your option.

About

A config-first design token CSS generator

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages