Skip to content

v4.0.0-prerelease.4

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 05 Dec 18:42
· 135 commits to main since this release
5b9bcbf

Minor Changes

  • 122c8f6: Expose a new utility called resolveReferences which takes a value containing references, the dictionary object, and resolves the value's references for you.

    import StyleDictionary from 'style-dictionary';
    import { resolveReferences } from 'style-dictionary/utils';
    
    const sd = new StyleDictionary({
      tokens: {
        foo: { value: 'foo' },
        bar: { value: '{foo}' },
        qux: { value: '{bar}' },
      },
    });
    
    console.log(resolveReferences(sd.tokens.qux.value, sd.tokens)); // 'foo'
  • 122c8f6: BREAKING: expose getReferences and usesReference utilities as standalone utils rather than requiring them to be bound to dictionary object. This makes it easier to use.

Patch Changes

  • 044123c: Patch StyleDictionary main type file to export default instead of "export =" which does not work in ESM.