@design-sync/w3c-dtfm
v0.11.2
Published
Design tokens module format (DTFM) utils and types
Downloads
147
Readme
@design-sync/w3c-dtfm
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.