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

Variable aliases do not take into account token prefix settings #277

Open
distolma opened this issue Sep 25, 2023 · 1 comment
Open

Variable aliases do not take into account token prefix settings #277

distolma opened this issue Sep 25, 2023 · 1 comment

Comments

@distolma
Copy link

Hi, thanks for the great plugin. While working with it, I noticed that when exporting JSON, it does not take into account the "Include token prefix in token names" setting when generating aliases. That's why when converting JSON to CSS, I get an error that "Reference doesn't exist".

Here is an example of a generated file with one token and an alias:

{
  "color": {
    "gray": {
      "200": {
        "type": "color",
        "value": "#d3d3d3ff",
        "blendMode": "normal",
        "extensions": {
          "org.lukasoppermann.figmaDesignTokens": {
            "collection": "Primitives",
            "scopes": [
              "ALL_SCOPES"
            ],
            "variableId": "VariableID:1:4",
            "exportKey": "variables"
          }
        }
      }
    },
    "text": {
      "secondary": {
        "type": "color",
        "value": "{primitives.color.gray.200}",
        "extensions": {
          "org.lukasoppermann.figmaDesignTokens": {
            "collection": "Tokens",
            "scopes": [
              "ALL_SCOPES"
            ],
            "variableId": "VariableID:1:10",
            "exportKey": "variables"
          }
        }
      }
    },
  }
}

Plugin settings:
CleanShot 2023-09-25 at 13 11 06@2x

CleanShot 2023-09-25 at 13 11 46@2x

I managed to fix it, so I'm ready to create a PR.

@lukasoppermann
Copy link
Owner

Hey, so you are saying you would want to have e.g. colors in the name of the token as well? Feel free to add a PR for this.

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

2 participants