forked from axa-ch/design-tokens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ts
36 lines (34 loc) · 1.14 KB
/
build.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import './transform/index';
import { StyleDictionary } from 'style-dictionary-utils';
import { customMediaFormatter } from './formats/custom-media';
import { scssCssVarsMixinFormatter } from './formats/scss-css-vars-mixin';
import { scssMediaQueryFormatter } from './formats/scss-mq';
import { tailwindFormatter } from './formats/tailwind/index';
import { jsonTransformer } from './formats/json';
import { tailwind } from './platforms/tailwind';
import { css } from './platforms/css';
import { scss } from './platforms/scss';
import { json } from './platforms/json';
import { javascript } from './platforms/javascript';
import { scssMixin } from './platforms/scss-mixins';
const styleDictionary = new StyleDictionary({
source: ['tokens/**/*.json'],
hooks: {
formats: {
'css/custom-media': customMediaFormatter,
'scss/media-query': scssMediaQueryFormatter,
'scss/css-vars-mixin': scssCssVarsMixinFormatter,
'json/tokens': jsonTransformer,
tailwind: tailwindFormatter,
},
},
platforms: {
tailwind,
css,
scss,
scssMixin,
js: javascript,
json,
},
});
await styleDictionary.buildAllPlatforms();