@dnanpm/design-tokens
v0.0.6
Published
Design tokens for the DNA Design System
Readme
DNA Design Tokens
⚠️ Under Heavy Development — This package is actively being developed. Breaking changes may occur between minor versions during the 0.x release cycle.
Design tokens for the DNA Design System. This package follows W3C Design Tokens specification and uses Style Dictionary to transform tokens defined in JSON into multiple platform outputs.
Features
- Consistent design tokens across platforms
- JavaScript/TypeScript support
- CSS/SCSS variables
- Semantic naming conventions
- Supports color, typography, sizing, and spacing tokens
Installation
npm install @dnanpm/design-tokens
# or
yarn add @dnanpm/design-tokens
# or
pnpm add @dnanpm/design-tokensUsage
CSS Custom Properties
@import '@dnanpm/design-tokens/css';SCSS Variables
@import '@dnanpm/design-tokens/scss';JavaScript/TypeScript
Named imports (the javascript/es6 output uses named exports — there is no default export):
import * as tokens from '@dnanpm/design-tokens';
// tokens.ColorsPrimitivePink500 → '#da0070ff'or with tree-shaking:
import { ColorsPrimitivePink500, ColorsSemanticForegroundDefault } from '@dnanpm/design-tokens';CSS Variable Naming Convention
CSS custom properties follow the token path converted to kebab-case:
| Token path | CSS variable |
| ------------------------------------ | ------------------------------------------- |
| colors.primitive.pink.500 | var(--colors-primitive-pink-500) |
| colors.semantic.foreground.default | var(--colors-semantic-foreground-default) |
| spacing.primitive.size16 | var(--spacing-primitive-size-16) |
Contributing
- How to Contribute — contribution guide for design tokens
