Skip to content

Latest commit

 

History

History
74 lines (54 loc) · 1.87 KB

README.md

File metadata and controls

74 lines (54 loc) · 1.87 KB

@design-sync/w3c-dtfm

npm version npm downloads

Design tokens module format (DTFM) utils and types

Usage

Install package:

# npm
npm install @design-sync/w3c-dtfm

# yarn
yarn add @design-sync/w3c-dtfm

# pnpm
pnpm install @design-sync/w3c-dtfm

# bun
bun install @design-sync/w3c-dtfm

Import:

import { TokensWalker } from "@design-sync/w3c-dtfm";

const tokens = {
  "color": {
    "primary": {
      "$value": "#000000",
      "$type": "color"
    }
  }
  ... // rest of tokens
};
const walker = new TokensWalker(tokens);

walker.walk((token) => {
  // do something with token
  console.log(token);
});

Development

  • Clone this repository
  • Install latest LTS version of Node.js
  • Enable Corepack using corepack enable
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Made with 💛

Published under MIT License.