@tokens-studio/sd-transforms
Advanced tools
Changelog
1.0.0
67edf4b: BREAKING: descriptionToComment
transform no longer removes newlines, just turns carriage returns into newlines. Style Dictionary now handles comments with newlines properly in its createPropertyFormatter utility.
67edf4b: BREAKING: Remove expand
option, composite/object-value tokens must be expanded by using Style Dictionary Expand.
67edf4b: BREAKING: remove CommonJS entrypoint and tools/scripts required to dual publish. Now that Style Dictionary v4 is ESM-only, this library will follow suit.
67edf4b: BREAKING: transformFontWeights
has been renamed to transformFontWeight
for consistency.
Apply transforms to object-value (composite) token types:
This also means that all transforms except for description to comment mapping are now transitive transforms, since the math resolve transform must be transitive and all other transforms must apply after the math one.
67edf4b: BREAKING: remove CSS shorthand transforms for border, typography and shadow. Use the Style Dictionary transforms instead: https://styledictionary.com/reference/hooks/transforms/predefined/#bordercssshorthand.
Note that if you're not disabling the withSDBuiltins
option, the tokens-studio
transformGroup will include the ones in the css
built-in transformGroup, so you might not notice the fact that they are moved.
67edf4b: - BREAKING: Compatible with Style Dictionary >= v4.0.0. Not compatible with anything below that SD version.
registerTransforms
function has been renamed to register
.transforms
array has been refactored to getTransforms()
, which is a function you should call. Optionally pass in the new platform option as parameter { platform: 'css' /* or 'compose' */}
tokens-studio
transformGroup will include the platform's Style Dictionary built-in transforms. E.g. if you're registering for platform css
it will include the css
transformGroup transforms from Style Dictionary, appended to the Tokens Studio specific transforms. This behavior can be disabled by passing { withSDBuiltins: false }
.register()
call: register(SD, { platform: 'compose' })
. Default value is 'css'
. This means your tokens-studio
group will be registered for that specific platform.name
to the register()
call to configure the transformGroup name: register(SD, { name: 'tokens-studio-css' })
. Default value is tokens-studio
.Changelog
0.16.1
Changelog
0.16.0
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.Changelog
0.15.2
Changelog
0.15.1
Changelog
0.15.0
09b1fc0: BREAKING: remove options addAttributeCTI
& casing
.
Since transformGroup
can now be combined with transforms
, this is now much easier to accomplish in Style-Dictionary without additional sd-transforms options.
Before:
registerTransforms(StyleDictionary, { addAttributeCTI: true, casing: 'kebab' });
After:
{
"platforms": {
"css": {
"transformGroup": "tokens-studio",
"transforms": ["attribute/cti", "name/kebab"]
}
}
}
From this version onwards, Style-Dictionary v4.0.0-prerelease.19 minimum is required.
Changelog
0.14.4
Changelog
0.14.3
Changelog
0.14.2
Changelog
0.14.1