mikaelvesavuori / figmagic

Figmagic is the missing piece between DevOps and design: Generate design tokens, export graphics, and extract design token-driven React components from your Figma documents.
https://docs.figmagic.com
MIT License
807 stars 71 forks source link

Support images in elements #127

Open mikaelvesavuori opened 2 years ago

mikaelvesavuori commented 2 years ago

Currently, when generating elements (i.e. "React components"), images are not supported.

Example: If you were to generate a button with a background-image, the generation would attempt to understand the general CSS properties but bypass the image.

I assume that an implementation of this would result in a background-image property to be generated. It would also be necessary to download the image and ensure that one is correctly pointing to it.

glouhaichi commented 2 years ago

@mikaelvesavuori is this the same issue as elements not referencing icons (graphics) they were built with in Figma? For example, we have buttons with leading and trailing icons, and these icons are configured as graphics that are pulling correctly using Figmagic. However, the imported button elements are not referencing said graphics in the generated React component.

mikaelvesavuori commented 2 years ago

Almost. This issue is about images as defined in CSS. Your issue is about supporting image references in elements, if I am not mistaken. Both of these cases are currently not supported.