bernaferrari / FigmaToCode

Generate responsive pages and apps on HTML, Tailwind, Flutter and SwiftUI.
https://www.figma.com/community/plugin/842128343887142055
GNU General Public License v3.0
3.58k stars 262 forks source link

svg option #75

Open beyaz opened 11 months ago

beyaz commented 11 months ago

is there any option export images as svg base64 string ? just assigned to src property of img tag

bernaferrari commented 11 months ago

Yes, but that's complex. I can't differentiate an svg from png. Sometimes it is a group of vectors, then it is easy, but if there are frames or rectangles mixed together, what do I do? I never solved this.

Still, I want something like a export to code sandbox where I would do this.

beyaz commented 11 months ago

If you have decided that an element is a picture, you can go something like this. As you know, we can export as svg or png by selecting the export option in the right corner of Figma program. In fact, the image appears as base64 in the preview section.

Maybe you can trigger these steps automatically in the background and get the base64 format of that picture.

image