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

Reference tokens auto-referencing themselves in the exported JSON #1

Closed
exhtml opened this issue Jul 28, 2023 · 4 comments
Closed

Reference tokens auto-referencing themselves in the exported JSON #1

exhtml opened this issue Jul 28, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@exhtml
Copy link

exhtml commented Jul 28, 2023

Hi! I've testing the plugin and it works perfect! but I've detected that when using references, in the exported JSON you are auto-referencing the current token instead of the correct reference token. Example with a Semantic Color collection with tokens referencing Primitive Color collection:

{
"Semantic: Color": {
  "Light": {
    "Brand": {
      "Red (TR-600)": {
         "$value": "{Semantic: Color.Light.Colors.Red.600}",
         "$type": "color",
       //...
},

"Primitive: Color": {
  "Colors": {
    "Red": {
      "600": {
        "$value": "hsla(4, 77%, 48%, 1)",
        "$type": "color",
        // ...
        "$extensions": {
          "variableId": "VariableID:8414:43621",
          "aliasPath": "{Primitive: Color.Colors.Red.600}"
         }
},

Thanks for checking it!

PavelLaptev added a commit that referenced this issue Jul 28, 2023
issue - #1
PavelLaptev added a commit that referenced this issue Jul 28, 2023
@PavelLaptev
Copy link
Collaborator

@exhtml thank you for reporting this. Just published a new version. Can you please check if it works for you?
(You'll need to refresh the tab where you want to run the plugin in order to reset the cached version)

@PavelLaptev PavelLaptev added the bug Something isn't working label Jul 28, 2023
@exhtml
Copy link
Author

exhtml commented Jul 31, 2023

Hi @PavelLaptev , now seemst to make the correct export, thank you very much for your time!
On other subject, are you planning to implement any kind of parser to make the output JSON compatible with Style Dictionary? Something similar to what's explained greatly by Lukas Oppermann here https://lukasoppermann.medium.com/w3c-design-tokens-with-style-dictionary-f7ff5f2ba98c
There's something similar for Tokens Studio: https://github.com/tokens-studio/figma-plugin/tree/main/token-transformer
I'll give it a try and let you know!

@PavelLaptev
Copy link
Collaborator

PavelLaptev commented Jul 31, 2023

@exhtml sure thing. Currently, I'm working with style dictionary and planning to add my workarounds this week. So, stay tuned 🙂

@PavelLaptev
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants