0.5.0 • Published 2 years ago

@cobalt-ui/plugin-ts v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@cobalt-ui/plugin-ts

Generate TypeScript output from design tokens.

npm i -D @cobalt-ui/plugin-ts
// tokens.config.mjs
import ts from '@cobalt-ui/plugin-ts';
import better from 'better-color-tools';

/** @type import('@cobalt-ui/core').Config */
export default {
  plugins: [
    ts({
      /** set the filename inside outDir */
      filename: './index.ts',
      /** modify values */
      transform(token, mode) {
        // convert colors to P3
        switch (token.$type) {
          case 'color': {
            return better.from(token.$value).p3;
          }
        }
      },
    }),
  ],
};
0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.1.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.0.0

2 years ago