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

npm run transform-tokens cant find "global" form figma plugin export #39

Open
TBrayner opened this issue Oct 22, 2022 · 1 comment
Open

Comments

@TBrayner
Copy link

TBrayner commented Oct 22, 2022

"Reference doesn't exist: global.color.primary-base.value tries to reference brand.accenture.primary-base, which is not defined"

Once the figma Plugin creates this "Global" key, the token-transformer can't find it, I'm including it manually

image

to this:

image

{
  "global": {
    "brand": {
      "accenture": {
        "primary-base": {
          "value": "#A100FF",
          "type": "color",
          "description": "Base Accenture Color"
        },
        "secondary": {
          "value": "#0041F0",
          "type": "color"
        }
      }
    },
    "color": {
      "primary-base": {
        "value": "{brand.accenture.primary-base}",
        "type": "color"
      }
    },
    "black": {
      "12": {
        "value": "rgba(0,0,0,0.12)",
        "type": "color"
      },
      "25": {
        "value": "rgba(0,0,0,0.25)",
        "type": "color"
      },
      "50": {
        "value": "rgba(0,0,0,0.5)",
        "type": "color"
      },
      "85": {
        "value": "rgba(0,0,0,0.85)",
        "type": "color"
      },
      "100": {
        "value": "#000",
        "type": "color"
      }
    }
  },
  "font": {},
  "$themes": [],
  "$metadata": {
    "tokenSetOrder": [
      "global",
      "font"
    ]
  }
}
@lukasoppermann
Copy link
Owner

Hey @TBrayner,

the plugin does not by itself include a global key. This must be your to level in figma. Is that correct?

You need to write the entire path out in the references. I hope that helps, otherwise please clarify the question.

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