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

An easy way to support vectors #30

Open
oney opened this issue Mar 30, 2021 · 0 comments
Open

An easy way to support vectors #30

oney opened this issue Mar 30, 2021 · 0 comments

Comments

@oney
Copy link

oney commented Mar 30, 2021

It seems that vectors are not supported now.
An easy way to support vectors is if the node's type === "VECTOR" and also has export settings, convert it to <img src="IMAGE_HOST/name.ext" />

For example (the following json is from https://api.figma.com/v1/files/ downloaded json file because I don't set up a Figma plugin dev environment)

{
  "id": "6:3",
  "name": "Camera",
  "type": "BOOLEAN_OPERATION", // not sure if there is this type in plugin environment
  "blendMode": "PASS_THROUGH",
  // ...
  "exportSettings": [
    {
      "suffix": "",
      "format": "PNG",
      "constraint": { "type": "SCALE", "value": 1.0 }
    },
    {
      "suffix": "@2x",
      "format": "PNG",
      "constraint": { "type": "SCALE", "value": 2.0 }
    },
    {
      "suffix": "@3x",
      "format": "PNG",
      "constraint": { "type": "SCALE", "value": 3.0 }
    }
  ],
}

and covert it to <img src="IMAGE_HOST/Camera.png" />.
Then users can download exported images from Figma and place them into a folder, and then replace all IMAGE_HOST with the correct path.

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

1 participant