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

Allow references without .value #721

Closed
markacianfrani opened this issue Oct 19, 2021 · 5 comments
Closed

Allow references without .value #721

markacianfrani opened this issue Oct 19, 2021 · 5 comments

Comments

@markacianfrani
Copy link
Contributor

Currently, for outputReferences to work, you need to define your reference using .value like:

      "base"  : { "value": "{size.font.medium.value}" }

If your reference doesn't include .value it won't work:

    "base"  : { "value": "{size.font.medium}" }

The design tokens working group first draft actually has the reference defined without .value

{
  "group name": {
    "token name": {
      "value": 1234
    }
  },
  "alias name": {
    "value": "{group name.token name}"
  }
}

Would you be open to supporting references without .value to better align with the spec's working draft?

From what I can tell, we'd just need to modify around line 91 of https://github.com/amzn/style-dictionary/blob/main/lib/common/formatHelpers/createPropertyFormatter.js to maybe check if it's object and if the object has a value property, use that instead.

Would be happy to put in a PR if you think that's a good approach.

@lukasoppermann
Copy link
Contributor

Would love this as well.

@phantasmagoriadigital
Copy link

+1 This would be really helpful to synchronise our tokens between figma tokens and style dictionary. That way we can keep all our tokens as per W3C spec.

@esthercheran
Copy link

+1 Would be really helpful for us too.

@zetareticoli
Copy link

+1 Would be really useful to stay aligned with Figma plugin and Style Dictionary output

@chazzmoney
Copy link
Collaborator

Closed via #746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants