-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.js
111 lines (105 loc) · 2.55 KB
/
config.js
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
const BASE_OPTIONS = {
basePxFontSize: 16,
outputReferences: true,
}
module.exports = {
source: ['tokens/**/*.json', 'tokens/**/*.json5', 'tokens/**/*.js'],
platforms: {
css: {
...BASE_OPTIONS,
buildPath: 'dist/web/css/',
files: [
{
destination: 'variables.css',
format: 'css/variables',
},
{
// For Font Loading
destination: 'fonts.css',
filter: {
attributes: {
category: 'asset',
type: 'font',
},
},
format: 'css/fontface',
},
],
transforms: [
'attribute/cti',
'name/cti/kebab',
'size/breakpoint-radius/px',
'size/other/pxToRem',
'media-query/quote',
'time/seconds',
'content/icon',
// Use CSS format that will output Hex or RGBA accordingly if the alpha
// channel is needed.
'color/css',
],
},
'css-px': {
...BASE_OPTIONS,
buildPath: 'dist/web/css/',
files: [
{
destination: 'variables-px.css',
format: 'css/variables',
},
],
transforms: [
'attribute/cti',
'name/cti/kebab',
'size/px',
'media-query/quote',
'time/seconds',
'content/icon',
// Use CSS format that will output Hex or RGBA accordingly if the alpha
// channel is needed.
'color/css',
],
},
typescript: {
...BASE_OPTIONS,
actions: ['typescript/copy-constants'],
buildPath: 'dist/web/typescript/',
files: [
{
destination: 'design-tokens.d.ts',
format: 'typescript/es6-declarations',
},
{
destination: 'design-tokens.js',
format: 'javascript/es6',
},
],
transforms: [
'attribute/cti',
'name/cti/pascal',
'size/breakpoint-radius/px',
'size/other/pxToRem',
'color/css',
],
},
'typescript-px': {
...BASE_OPTIONS,
actions: ['typescript/copy-constants'],
buildPath: 'dist/web/typescript/',
files: [
{
destination: 'design-tokens-px.d.ts',
format: 'typescript/es6-declarations',
},
{
destination: 'design-tokens-px.js',
format: 'javascript/es6',
},
],
transforms: ['attribute/cti', 'name/cti/pascal', 'size/px', 'color/css'],
},
tailwindcss: {
...BASE_OPTIONS,
actions: ['tailwindcss/copy-config'],
},
},
}