forked from aws-amplify/amplify-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsd.config.ts
44 lines (41 loc) · 939 Bytes
/
sd.config.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
37
38
39
40
41
42
43
44
/*
* Style Dictionary config
*/
import StyleDictionary from 'style-dictionary';
import { defaultTheme } from './src/theme';
import {
CSS_VARIABLE_PREFIX,
cssNameTransform,
cssValue,
} from './src/theme/utils';
const CSS_VARIABLE_SCOPE = ':root, [data-amplify-theme]';
StyleDictionary.extend({
tokens: defaultTheme.tokens,
transform: {
cssNameTransform: {
type: 'name',
transformer: cssNameTransform,
},
cssValue: {
type: 'value',
transitive: true,
transformer: cssValue,
},
},
platforms: {
css: {
transforms: ['attribute/cti', 'cssNameTransform', 'cssValue'],
prefix: CSS_VARIABLE_PREFIX,
files: [
{
destination: 'dist/theme.css',
format: 'css/variables',
options: {
selector: CSS_VARIABLE_SCOPE,
outputReferences: true,
},
},
],
},
},
}).buildAllPlatforms();