Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not resolve references to zero #324

Closed
dbanksdesign opened this issue Sep 6, 2019 · 0 comments
Closed

Does not resolve references to zero #324

dbanksdesign opened this issue Sep 6, 2019 · 0 comments
Labels

Comments

@dbanksdesign
Copy link
Member

Scenario:
If a design token/style property has a value of 0 (a number, not a string) and you have a reference/alias to that value, when you build Style Dictionary says the reference doesn't exist.

Here is a quick test:

const StyleDictionary = require('style-dictionary');

StyleDictionary.extend({
  properties: {
    test: { value: "{zero.value}" },
    zero: { value: 0 }
  },
  platforms: {
    css: {
      transformGroup: 'web',
      files: [{
        destination: "test.css",
        format: "css/variables"
      }]
    }
  }
}).buildAllPlatforms();
MDemetrio pushed a commit to MDemetrio/style-dictionary that referenced this issue Nov 8, 2019
fixes amzn#324

Adding proper checking for alias/reference resolution so that 0 is a valid value. Now we check for undefined rather than "truthiness", because 0 is "false".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant