Style Dictionary Versions Save

A build system for creating cross-platform styles.

v4.0.0-prerelease.15

4 months ago

Major Changes

  • 502dbd1: BREAKING: All of our hooks, parsers, preprocessors, transforms, formats, actions, fileHeaders and filters, support async functions as well now. This means that the formatHelpers -> fileHeader helper method is now asynchronous, to support async fileheader functions.

    import StyleDictionary from 'style-dictionary';
    
    const { fileHeader } = StyleDictionary.formatHelpers;
    
    StyleDictionary.registerFormat({
      name: 'custom/css',
      // this can be async now, usually it is if you use fileHeader format helper, since that now always returns a Promise
      formatter: async function ({ dictionary, file, options }) {
        const { outputReferences } = options;
        return (
          // this helper is now async! because the user-passed file.fileHeader might be an async function
          (await fileHeader({ file })) +
          ':root {\n' +
          formattedVariables({ format: 'css', dictionary, outputReferences }) +
          '\n}\n'
        );
      },
    });
    

v4.0.0-prerelease.14

4 months ago

Minor Changes

  • 606af51: Rename typeW3CDelegate utility function to typeDtcgDelegate, as using "W3C" is highly discouraged when the standard isn't a W3C standard yet.
  • 606af51: Support the use of "value"/"type"/"description" as token names or token group names, at the sacrifice of now no longer being able to combine non-DTCG and DTCG syntax within the same token dictionary.

Patch Changes

  • cd9f484: Escape double quotes for ts outputStringLiterals

v4.0.0-prerelease.13

5 months ago

Patch Changes

  • 24584b4: Conditionally only run dev scripts when CWD is style-dictionary, so our consumers don't run it by accident

v4.0.0-prerelease.12

5 months ago

Patch Changes

  • c2cbd1b: Publish the postinstall-dev script to NPM.

v4.0.0-prerelease.11

5 months ago

Patch Changes

  • cd48aac: Only run postinstall scripts when NODE_ENV isn't production (e.g. npm install --production or --omit=dev). To avoid errors running husky/patch-package.

v4.0.0-prerelease.10

5 months ago

Patch Changes

  • 0c1a36f: Fix small issue in type w3c delegate utility type tracking.
  • 0c1a36f: Expose typeW3CDelegate utility. Don't take "value" into account anymore to determine that it's a design token, use $value.

v4.0.0-prerelease.9

5 months ago

Minor Changes

  • 294fd0e: Support W3C Draft specification for Design Tokens, by adding support for $value, $type and $description properties.

Patch Changes

  • 3138313: Allow transitive transforms to return undefined, by doing this the transformer can mark itself as "deferred" for that specific token. This is useful when references in properties other than "value" need to be resolved first.

v4.0.0-prerelease.8

5 months ago

Patch Changes

  • 59f3eb0: Expose flattenTokens utility.
  • 39547fb: Fix parsers async support, use resolved filePath instead of raw.

v4.0.0-prerelease.7

5 months ago

Minor Changes

  • 0410295: Improve and test the error handling of standalone usage of reference utilities.

v4.0.0-prerelease.6

6 months ago

Patch Changes

  • 1dd828c: Fix issue in browser-bundled glob, bump.