You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BREAKING: update to Style Dictionary `v4.0.0-prerelease.27`, set preprocessor name to `'tokens-studio'`, which now has to be applied if you want to exclude parent keys, expand composite types or add font style properties to typography values.
// that is installed as a dependency of this package.
68
82
registerTransforms(StyleDictionary);
69
83
70
84
constsd=StyleDictionary.extend({
71
85
source: ['**/*.json'], // <-- make sure to have this match your token files!!!
86
+
preprocessors: ['tokens-studio'], // <-- since 0.16.0 this must be explicit
72
87
platforms: {
73
88
css: {
74
-
transformGroup:'tokens-studio',
89
+
transformGroup:'tokens-studio',// <-- apply the tokens-studio transformGroup to apply all transforms
75
90
transforms: ['name/kebab'], // <-- add a token name transform for generating token names, default is camel
76
91
buildPath:'build/css/',
77
92
files: [
@@ -98,11 +113,25 @@ node build-output.js
98
113
99
114
> From Style-Dictionary `4.0.0-prerelease.18`, [`transformGroup` and `transforms` can now be combined in a platform inside your config](https://github.com/amzn/style-dictionary/blob/v4/CHANGELOG.md#400-prerelease18).
100
115
116
+
### Using the preprocessor
117
+
118
+
If you want to use `excludeParentKeys`, `expand` or allow this package to extract the `fontStyle` from the `fontWeight` e.g. `regular italic`,
119
+
you must add the `'tokens-studio'` preprocessor explicitly in the configuration:
120
+
121
+
```json
122
+
{
123
+
"source": ["**/*.tokens.json"],
124
+
"preprocessors": ["tokens-studio"],
125
+
"platforms": {}
126
+
}
127
+
```
128
+
101
129
### Using the transforms
102
130
103
131
```json
104
132
{
105
133
"source": ["**/*.tokens.json"],
134
+
"preprocessors": ["tokens-studio"],
106
135
"platforms": {
107
136
"css": {
108
137
"transformGroup": "tokens-studio",
@@ -130,31 +159,31 @@ node build-output.js
130
159
```
131
160
132
161
More fine-grained control is possible, every transformation is available as a raw JavaScript function
133
-
for you to create your own Style-Dictionary transformer out of.
162
+
for you to create your own Style-Dictionary transform out of.
> From Style-Dictionary `4.0.0-prerelease.18`, [`transformGroup` and `transforms` can now be combined in a platform inside your config](https://github.com/amzn/style-dictionary/blob/v4/CHANGELOG.md#400-prerelease18).
151
180
152
-
You can create a custom transformGroup that includes the individual transforms from this package.
153
-
If you wish to use the transformGroup, but adjust or remove a few transforms, your best option is to create a custom transform group:
181
+
You can create a custom `transformGroup` that includes the individual transforms from this package.
182
+
If you wish to use the `transformGroup`, but adjust or remove a few transforms, your best option is to create a custom transform group:
0 commit comments