@base-org/bds-tokens
v0.0.1
Published
Spectrum design tokens for Base products, as CSS custom properties and typed TypeScript values.
Readme
@base-org/bds-tokens
Spectrum design tokens for Base products, as CSS custom properties and typed TypeScript values.
yarn add @base-org/bds-tokensCSS custom properties
Import the token sheet into your global CSS. This defines the --bds-* custom properties that
@base-org/bds-web components consume.
@import '@base-org/bds-tokens/tokens/spectrum.css';A mobile variant is available at @base-org/bds-tokens/tokens/spectrum.mobile.css.
TypeScript values
The same palette is exported as typed values, for cases where a token has to be read in JS (canvas rendering, chart libraries, inline styles).
import { lightSpectrum, darkSpectrum } from '@base-org/bds-tokens';Regenerating
spectrum.css and spectrum.mobile.css are generated from src/tokens/spectrum.ts. After editing
the source tokens:
yarn generate:spectrumyarn verify:spectrum checks that the committed CSS matches the generator, and runs in CI.
Full setup instructions live in the repository README.
