@streamoid/tokens
v0.1.0
Published
Streamoid design tokens — colors, spacing, radius, typography. Canonical CSS variables (dark + light themes) plus typed JS exports.
Downloads
518
Readme
@streamoid/tokens
Canonical Streamoid design tokens — single source of truth for colors, spacing, radius and typography, shared across all products (cxo-dashboard, artifax, photogenix, catalogix, …).
- Dark theme is the default (
:root). - Light theme applies via
[data-theme="Light"]on<html>. - The JS exports are generated from the CSS (
scripts/generate.mjs) so they can never drift.
Install
npm i @streamoid/tokensUse the CSS (canonical)
Import once, as early as possible in your app:
@import "@streamoid/tokens/tokens.css";Then reference tokens in any stylesheet:
.card {
background: var(--alias-surface-base);
color: var(--alias-text---icons-primary);
border: 1px solid var(--alias-border-subtle);
box-shadow: var(--alias-shadow-sm);
}Switching themes
// light
document.documentElement.setAttribute("data-theme", "Light");
// dark (default)
document.documentElement.removeAttribute("data-theme");Light-mode elevation
Light surfaces are mostly white on a slight-grey canvas, so elevation is carried by shadow + border, not by lighter surfaces. Apply by role:
| Role | Surface | Shadow |
| --- | --- | --- |
| Card | --alias-surface-raised | --alias-shadow-sm |
| Popover / menu | --alias-surface-raisedoverlay | --alias-shadow-md |
| Modal / dialog | --alias-surface-overlay | --alias-shadow-lg |
Use the JS/TS exports
For charts, canvas, React Native, emails, or inline styles:
import { cssVar, light, dark } from "@streamoid/tokens";
// theme-aware (follows the active [data-theme])
<div style={{ background: cssVar("alias-surface-canvas") }} />
// resolved hex (e.g. for a chart library that needs a literal)
const grid = light.primitives.neutral["800"]; // "#d2d2d2"
const brand = dark.fill["info-solid"]; // "#1a6fff"Develop
npm run build # generate JS from CSS, bundle, emit types, copy css to distEdit
src/tokens.cssonly.src/generated.tsis produced by the build — never edit it by hand.
