Releases: tokens-studio/sd-transforms
v1.1.0
Minor Changes
- c687817: Add the
originalType
property to$extensions.['studio.tokens']
to store the original Tokens Studio token type, when the type is aligned to DTCG types. LetterSpacing transform is the transform in this package that actually needs to use this, because it doesn't want to match all dimension tokens, but it does want to match letterSpacing tokens. - ed10715: Allow changing the resolve math transform amount of decimals to round for using platform options
mathFractionDigits
, change default value from 3 to 4.
Patch Changes
v1.0.1
v1.0.0
Major Changes
-
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 totransformFontWeight
for consistency.Apply transforms to object-value (composite) token types:
- HEXRGBa transform applies to border and shadow colors
- Px dimension transform applies to border, typography and shadow dimensions
- Letterspacing, lineheights and fontweights transforms apply to these respective typography properties
- Resolve math transform applies to all properties of border, typography and shadow tokens
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, thetokens-studio
transformGroup will include the ones in thecss
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.
- BREAKING:
registerTransforms
function has been renamed toregister
. - BREAKING:
transforms
array has been refactored togetTransforms()
, which is a function you should call. Optionally pass in the new platform option as parameter{ platform: 'css' /* or 'compose' */}
- BREAKING: By default, registered
tokens-studio
transformGroup will include the platform's Style Dictionary built-in transforms. E.g. if you're registering for platformcss
it will include thecss
transformGroup transforms from Style Dictionary, appended to the Tokens Studio specific transforms. This behavior can be disabled by passing{ withSDBuiltins: false }
. - Allow passing platform to the
register()
call:register(SD, { platform: 'compose' })
. Default value is'css'
. This means yourtokens-studio
group will be registered for that specific platform. - Allow passing
name
to theregister()
call to configure the transformGroup name:register(SD, { name: 'tokens-studio-css' })
. Default value istokens-studio
.
- BREAKING: