theme-tokens
v0.0.1
Published
Tiny CSS color-token primitives for design systems.
Maintainers
Readme
Theme Tokens
Tiny CSS color-token primitives for design systems.
theme-tokens turns a plain color map into normalized CSS custom properties and provides matching var(...) references. It stays deliberately small so token storage can live in your existing system.
Not published yet. It builds from source in this repository.
Usage
import { colorToken, createColorTokens, tokensToCss } from "theme-tokens";
const colors = createColorTokens({ brandPrimary: "oklch(62% 0.18 250)", ink: "#111827" });
const css = tokensToCss(colors);
const buttonColor = colorToken("brandPrimary");API
| Export | Purpose |
| --- | --- |
| createColorTokens | Normalize and freeze a color-token map. |
| colorToken | Create a var(--color-...) reference. |
| tokensToCss | Serialize tokens as a CSS rule. |
| ColorTokenMap | Type for a readonly token map. |
Development
npm run buildLicense
MIT
