-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Style Dictionary Output References #284
Comments
I think what the plugin should do is treat The W3C spec currently doesn't seem to follow what Style Dictionary does and define aliases the same way as Figma Tokens does - without the |
Good catch with the spec. I put in a PR on Style Dictionary itself to see if they'd be willing to make a change on their end. I feel like it's probably best to follow the spec in this case. Even though it's just a draft, I can't imagine that part changing. |
I have the same issue here with colors: Adding But Style Dictionary works fine this ways: $light-background: #fff;
$light-text: #111827;
$light-text-weak: #6b7280;
$light-text-light: #9ca3af;
$light-background-strong: #080b12;
$light-background-light: #f3f4f6;
$light-border: #e5e7eb;
$light-state-active: #c2410c;
$light-state-hover: #f97316;
$light-text-primary: #ea580c; If I remove the Any update on this? |
+1 |
We're waiting for a fix on Style Dictionary end for this as the W3C draft doesn't have the A PR seems to be coming 🙏 |
@six7 thanks for the update 🙏 |
@six7 Style dictionary PR merged 🎉 |
@six7 So I guess the fix in Style Dictionary (amzn/style-dictionary#746) with the optional Not sure if it should also work the other way around? I.e. being able to reference other tokens using
If not, then this issue could be closed... |
Agree, I think we can close this one for now. If we'd decide in the future to allow aliases to not just reference the value but also description or other custom fields on a token then we'd need something like that, but for now we're good. |
Looking at the docs for Style Dictionary's outputReferences support https://amzn.github.io/style-dictionary/#/version_3?id=output-references I noticed that their syntax is slightly different.
Given that I have a very basic typography style in Figma, the plugin outputs:
When ran through SD, using the basic config we get:
Their example shows you need to reference .value in your alias. So if we change our token.json to:
We get:
if we set
outputReferences
to true.Which is amazing.
Is this something the plugin should support out of the box? I'm not sure how others are using aliases because the first example doesn't work.
The text was updated successfully, but these errors were encountered: