Skip to content

Releases: amzn/style-dictionary

v5.0.0-rc.2

24 Apr 10:24
12f405a
Compare
Choose a tag to compare
v5.0.0-rc.2 Pre-release
Pre-release

Patch Changes

  • a9c0461: SD will use posix style paths ('/') as much as possible and rely on node:fs to translate to win32 paths whenever a call to the filesystem is done. The exception is for dynamic imports of JS files (SD config, token files).
  • a9c0461: Allow buildPaths without a trailing slash, by making use of path.join() utility.
  • 3a91a3f: Dynamically import prettier and plugins so that they can be chunked separately by bundlers, and only imported on demand. This will significantly improve bundle size for users of Style Dictionary.

v4.4.0

24 Apr 15:50
86c2c30
Compare
Choose a tag to compare

Minor Changes

  • f2395f3: Add a 'flat' option to the javascriptEsm format
  • 2f13dcb: Added support for using the selector option as a string or string array in the css/variables formatter. When an array is provided, the CSS variables will be nested within the specified selectors in order

Patch Changes

  • ee85609: fix misaligned comments in typescript/es6-declarations
  • 6ff17ec: If several preprocessors are defined in the SD configuration, the execution of the preprocessors is now guaranteed in the exact order in which they were configured in the SD configuration.

v5.0.0-rc.1

18 Mar 15:01
8f5dd25
Compare
Choose a tag to compare
v5.0.0-rc.1 Pre-release
Pre-release

Major Changes

  • 7909466: BREAKING: no longer possible to pass options to change the reference syntax {ref.foo}. The opening, closing and separator characters are now set to be aligned with the DTCG spec.

Minor Changes

  • d4a6fe8: When transform hooks throw errors, they will now be caught and error-handled by Style Dictionary.
    Instead of causing a fatal failure, the error is collected and logged as a warning at the end.
    With verbosity turned to "verbose", information about which tokens in which files are causing an error in which transform, to help debugging the problem.
    Sensible fallbacks are used when a transform cannot complete.

v5.0.0-rc.0

28 Feb 20:08
1dbb9cd
Compare
Choose a tag to compare
v5.0.0-rc.0 Pre-release
Pre-release

Major Changes

  • 2b2c154: No longer allow references to non-token leaf nodes. References only work when referencing a Design Token (its value).
    Non-token nodes will also not make it to the output, because they are filtered out during the flattening process to tokenMap and tokenArray.
    Remove allowing references with .value suffix.
  • 2b2c154: BREAKING: minimum NodeJS version required is now v22.0.0 (LTS, at time of writing this). This is to support Set.prototype.union which we utilize in our token reference resolution utility, and it's important to use the cheaper built-in versus doing a union manually.

Minor Changes

  • 2b2c154: Support passing Token Map structure to getReferences and resolveReferences utils.

v4.3.3

10 Feb 17:02
2f3d629
Compare
Choose a tag to compare

Patch Changes

  • ea0ec73: Fix convertToDTCG for sets that are already (partially) DTCG.
  • 1d4389a: - 'color/hex' (colorHex enum) built-in transform can now handle alpha channels properly by outputting hex8 format if needed. This also affects the transformGroups less and js which apply this transform.
    • 'color/hex8' (colorHex8 enum) built-in transform is now deprecated, use 'color/hex' (colorHex enum) instead.
  • e77feb4: Move the tinycolor2 patch from a patch file to a 3-liner fix in our source code, so it gets correctly published and usable by consumers.
  • 177c25e: Account for multiline comments in javascript/es6 format

v4.3.2

21 Jan 18:16
41bc1b0
Compare
Choose a tag to compare

Patch Changes

  • 7d60069: Hotfix for 'size/rem' => sizeRem transform to not change values with 'px' units to 'rem'. Regression was added in v4.3.1 (commit sha 1684a8e).

v4.3.1

21 Jan 00:25
6fc68b4
Compare
Choose a tag to compare

Patch Changes

  • 1684a8e: Fix sizeRem to allow negative values
  • 803d1f8: Fix gradients with rgba values returning rgba(0, 0, 0, 0)
  • 6cc1da3: Add and check types to CLI file, fix typo for --platform flag.

v4.3.0

10 Dec 20:21
737a02b
Compare
Choose a tag to compare

Minor Changes

  • 302b466: Introduce a new entrypoint: style-dictionary/enums for most of the library's hard-coded string values. Most of these are built-in hooks names. This provides better type-safety for consumers as well as various maintainability related benefits for this library. See documentation for more info.
  • 5aad797: Add tailwind preset example, remove unused .editorconfig file
  • bd8be17: Add support for native .TS token & config file processing.
  • 209085d: Add tokenMap properties to Dictionary, which is a JavaScript Map structure of the tokens, which makes it easy to iterate as well as access tokens. Also add convertTokenData utility that allows to seemlessly convert between Map, Object or Array of tokens, and deprecate the flattenTokens utility in favor of that one.

Patch Changes

  • 2966cfd: handle DTCG-format tokens in typescript/es6-declarations formatter
  • 4a7bca7: add accessControl field to Android Compose template
  • f694f67: Fix Prettier imports, see https://prettier.io/docs/en/api#custom-parser-api-removed for more info.
  • fd8cdb4: handle DTCG-format tokens in javascript/es6 formatter
  • 6a6a409: Move prettier to dependencies since style-dictionary isn't really a prettier plugin and a direct dependency seems more accurate here.
  • 8a9cfa0: Fix outputReferencesTransformed util, would return true for tokens which original values were not strings.
  • 7a661bb: Fix font-style and font-weight logic for fonts.css.template.js

v4.2.0

11 Nov 17:19
325d161
Compare
Choose a tag to compare

Minor Changes

  • 0fcf229: Add a new built-in format javascript/esm that outputs an ES module JS default export.
  • d7b5836: Mark javascript/esm as nested, use Prettier on all JavaScript/TypeScript formats, use 3.x.x peerDependency so the user's installation is used when possible.
  • 4bf68a3: Apply stripMeta from "json" format to the new "javascript/esm" as well.
  • 8f1b4f0: Add new utility in style-dictionary/utils -> stripMeta for stripping metadata from tokens.
    This utility is used now as an opt-in for the built-in 'json' format by using options.stripMeta, which if set to true will strip Style Dictionary meta props.
    You can specify keep/strip (allow/blocklist) for granular control about which properties to keep or strip.

Patch Changes

  • 5e3a5af: Update .d.ts/js files type imports to use correct extensions rather than extensionless. This fixes some incompatibilities with latest TypeScript "NodeNext" moduleResolution.

v4.1.4

21 Oct 16:06
399de13
Compare
Choose a tag to compare

Patch Changes

  • a67ed31: Pass PlatformConfig as options param to platform-applied preprocessors.
  • 19aee32: Fix convertToBase64 util to support converting binary files such as fonts, for both Browser and NodeJS.