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

Problematic colon character in image id tag #150

Closed BarnDotCom closed 2 years ago

BarnDotCom commented 2 years ago

We've just returned to using Figmagic on one of our projects that we haven't worked on in many months.

On our React Front-End, we immediately noticed an error syncing bitmapped graphics. While SVG graphics continue to display correctly, bitmapped ones now don't.

Looking at the HTML, it appears that synced bitmapped graphics now each have a unique ID, where they didn't before, see the old vs new in this screengrab:

screen_shot_2021-11-08_at_6 33 43_pm

It seems that the inclusion of the colon in the ID is preventing the graphics from displaying?

mikaelvesavuori commented 2 years ago

Hey! The generated images (SVG or bitmap) is "as-is", so Figmagic isn't doing anything in this part.

The colon seems to refer to a Figma node ID. This gave me the suspicion that your vector graphic includes a bitmap, so I set up a test on my own end (just a basic component made out of a vector rectangle and a PNG dummy printscreen). This seems to work just fine in an HTML file loading the SVG with <img src="graphics/Frame1.svg">.

This is not really a case I have considered, but at least on my end, it does seem to work in the intended way.

BarnDotCom commented 2 years ago

Thanks for the prompt reply Mike. It sounds like Figma may have adjusted something in a new version, as we have not changed the graphics in our design file. I have posted a support request here, hopefully someone from Figma will be able to assist: https://forum.figma.com/t/colon-in-html-id-attribute/10010

mikaelvesavuori commented 2 years ago

And for anyone interested, this seems to be highly related: https://forum.figma.com/t/svg-export-for-lineargradients-with-colons-in-id-showing-blank-in-chrome/9109

mikaelvesavuori commented 2 years ago

Since this is outside of Figmagic’s control, can we close this? We can always reopen if a solution presents itself.

BarnDotCom commented 2 years ago

Sure, fine by me, thanks again Mike.

On Nov 9, 2021, at 2:49 AM, Mikael Vesavuori @.***> wrote:



Since this is outside of Figmagic’s control, can we close this? We can always reopen if a solution presents itself.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mikaelvesavuori/figmagic/issues/150#issuecomment-963893883, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFJQW4EBPZSB4IF56LIQYMTULDHB3ANCNFSM5HTHWPGQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mikaelvesavuori commented 2 years ago

Closed as a Figma issue.