Skip to content

Releases: tokens-studio/sd-transforms

v1.1.0

04 Jul 14:44
01b5df5
Compare
Choose a tag to compare

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

  • c687817: Fix alignTypes to also include borderWidth, letterSpacing, paragraphSpacing and paragraphIndent and align them to dimension.
  • 9c02741: Fix bug where usesDtcg flag was not passed to resolveReference utility.

v1.0.1

01 Jul 14:02
b454787
Compare
Choose a tag to compare

Patch Changes

  • 6c7b2ff: Fix tsconfig to exclude test files and ensure dist folder structure is correct.

v1.0.0

01 Jul 11:47
57431ec
Compare
Choose a tag to compare

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 to transformFontWeight 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, 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.

    • BREAKING: registerTransforms function has been renamed to register.
    • BREAKING: 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' */}
    • BREAKING: By default, registered 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 }.
    • Allow passing platform to the register() call: register(SD, { platform: 'compose' }). Default value is 'css'. This means your tokens-studio group will be registered for that specific platform.
    • Allow passing name to the register() call to configure the transformGroup name: register(SD, { name: 'tokens-studio-css' }). Default value is tokens-studio.

Minor Changes

  • 67edf4b: Adjust add-font-styles parser to also run on tokens of type fontWeight, to create a sibling token for the fontStyle if it is included in the fontWeight token.
  • 67edf4b: Add an adjust-types preprocessor utility that aligns the Tokens Studio types / object-value props with the DTCG ones.

v0.9.2

26 May 14:38
9a58d98
Compare
Choose a tag to compare

Patch Changes

  • 01d45fd: Fix hex rgba regex matcher to be lazier about some character matching, warn for errors from colorjs.io hex parsing.

v0.9.1

17 May 09:25
9688197
Compare
Choose a tag to compare

Patch Changes

  • ce69ada: Consider that properties can also be empty string, which is especially common if the typography/border/shadow tokens are coming from Tokens Studio.

v0.9.0

16 May 20:40
0255ee2
Compare
Choose a tag to compare

Minor Changes

  • 24a20df: BREAKING: when missing properties inside typography, border or shadow objects, we prefill them with empty string, 0, or some default value.

v0.8.7

16 May 13:40
41f797b
Compare
Choose a tag to compare

Patch Changes

  • 3f12797: Exclude parent keys can lead to duplicate property keys. Ensure they are deepmerged instead of overwritten.

v0.8.6

11 May 09:15
6a79b6d
Compare
Choose a tag to compare

Patch Changes

  • 345e03e: Expose transforms names, so it's easy to create a custom transformGroup and adjust, add or remove transforms in it.

v0.8.5

28 Apr 08:13
28d0bba
Compare
Choose a tag to compare

Patch Changes

  • d637cec: Use Rollup output.interop for CJS output, to properly handle default exports in our CJS external dependencies.

v0.8.4

27 Apr 20:27
4410075
Compare
Choose a tag to compare

Patch Changes

  • d37eebc: Support values of type number for checkAndEvaluateMath utility.