-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild-tokens.js
More file actions
36 lines (33 loc) · 1.01 KB
/
build-tokens.js
File metadata and controls
36 lines (33 loc) · 1.01 KB
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
const { registerTransforms } = require('@tokens-studio/sd-transforms');
const StyleDictionary = require('style-dictionary');
registerTransforms(StyleDictionary);
const sd = StyleDictionary.extend({
source: ['./tokens/clamped.json'],
platforms: {
css: {
transforms: [
'ts/descriptionToComment',
'ts/resolveMath',
'ts/size/px',
'ts/size/letterspacing',
'ts/size/lineheight',
'ts/type/fontWeight',
'ts/color/hexrgba',
'ts/color/modifiers',
'ts/typography/css/shorthand',
'ts/shadow/shorthand',
'attribute/cti',
'name/cti/kebab',
],
buildPath: 'build/css/',
files: [
{
destination: 'variables.css',
format: 'css/variables',
},
],
},
},
});
sd.cleanAllPlatforms();
sd.buildAllPlatforms();