Join the conversation

Sign in to join this conversation, and others like it, in the communities you care about.

Figma

Figma is the first collaborative UI design tool built in the browser. Join our growing community and kick off a conversation!

Figma / Feature Requests

Cleaner SVG export

Cleaner SVG export

Figma / Feature Requests · July 20, 2017 at 6:33pm(Edited 1 year ago)
As an animator and developer, you want your SVG output as clean as possible. It would be nice if Figma could do it a bit more like Illustrator.
This is a quick comparison of the two. I will make an document with a rectangle 800x600 and draw a circle 200x200 in the middle.
The Illustrator output looks like this:  
Figma output looks like this:  
As you can see the Figma output adds allot more unnecessary code in my opinion. Which makes it allot harder to read and unusable for web animations. I hope you will add this feature.
Thanks!
Load previous messages

July 21, 2017 at 12:17am
Hey Martijn, thanks for the feedback! You're right that it could definitely be cleaned up a bit to make it more user friendly. I know that SVG export improvements are on our roadmap for the next few months, so thanks for hanging in there. One of our engineers is very passionate about this area – I'll make sure to pass your feedback to him.
like-fill
1
  • reply
  • like
Primitives, strokes, text, relative-transforms, and inlining paths and transforms are some of the items that we still need to tackle on SVG export. That should clean up the files that you get out of Figma. Currently we try to separate the scene graph (the tree of groups and shapes) from the large content (geometry and images). Then we de-duplicate those by referencing them xlink:href in the defs block, and we put that defs block last so that you scene could load as soon as the geometry is reached. This makes sense for large files, but less so for small icon exports where you want more compact output.
like-fill
2
  • reply
  • like
Illustrator has about 12 different options for SVG export, and Figma currently has 1. SVGO has even more, but some of them break the SVG output. There are lot of different ways to manipulate SVG for different outcomes. Inlining transforms multiplies the layer transform into the path, but also means you can't reuse that path. So in optimizing for one case, you then can't transfer that SVG into another design tool and have the transform.
like-fill
5
  • reply
  • like

August 30, 2017 at 7:43pm
I think it's worth considering the use case here too, I tried to export SVG for android and there's no way to use SVGs from Figma in an Android app at the moment. You need to run it through SVGO then refactor the code by hand to remove desc, defs etc.
like-fill
1
  • reply
  • like

September 1, 2017 at 5:28am
Android added defs support so that means Figma files should import more easily there from Figma.
like-fill
2
  • reply
  • like

October 17, 2017 at 4:36pm

An option to keep strokes in SVG exports would be great, so we can play with thickness or use vector-effect="non-scaling-stroke". I often design icons for web sites or apps, and have to draw/export them in Sketch (the horror). This is basically the only reason I still use Sketch. By the way, Sketch has a nice feature to keep strokes even if their position is "inside" or "outside".

like-fill
3
  • reply
  • like

October 25, 2017 at 7:21pm

Improved SVG support would be great. I am running into some wonky stuff right now. Like the background of the underlying frame being added to the SVG instead of a transparent background, and also shapes which are strokes being exported as solid fills. Having to do clean up in Illustrator right now :(

like-fill
1
  • reply
  • like

October 27, 2017 at 3:31am

Really need better svg exporting.

like-fill
1
  • reply
  • like

December 13, 2017 at 1:23pm

just adding another avatar to the requests for SVG exporting :) - I've got no details to add beyond what's already been written, but if the engineer who's passionate about the subject needs moral support and users in their corner, here's some of that :)

like-fill
1
  • reply
  • like

December 15, 2017 at 6:10pm

Hi folks! We're getting ready to beta test some SVG export improvements. If you're interested in participating, please DM me here on Spectrum, or on twitter at https://twitter.com/skuwamoto . Thanks!

like-fill
5
  • reply
  • like

December 16, 2017 at 3:34am
like-fill
1
  • reply
  • like

My quick 5 minute look at comparing exact same SVG with old export...shows huge improvement!!! Thank you @skuwamoto & team!!! Hopefully will get to spend some more time with them next weekend.

like-fill
3
  • reply
  • like

February 1, 2018 at 11:38am

Hi-hi! How could participate the beta test?

  • reply
  • like

February 12, 2018 at 5:10pm

Still super happy with the SVG improvements! Any idea when these improvements will roll out to all users?

  • reply
  • like

Yes, I definitely agree SVG needs to be cleaned up more. When I go into the file, the SVG has too many transforms, groups, etc.

  • reply
  • like

February 13, 2018 at 9:06am

Would love to participate in the beta test here!

  • reply
  • like

i use https://jakearchibald.github.io/svgomg/ for svg optimising

flow: copy svg code form figma > paste markup to svgomg > download optimized svg

  • reply
  • like

Does it clean up transforms in favor of flattened paths?

  • reply
  • like

The new Figma SVG export that Sho recruited some beta testers for is a HUGE improvement over the current SVG export. If you look at the image above that I posted, you can see the difference. Hopefully it makes it way into a future release once their testing concludes. The resulting files are much cleaner (and smaller).

like-fill
2
  • reply
  • like

February 14, 2018 at 12:41am

@ryngonzalez @andrewfluck You're now part of the beta! Let us know if you have feedback.

like-fill
1
  • reply
  • like

@thomas-lowry We're working on getting it out to all users, stay tuned!

like-fill
2
  • reply
  • like

Awesome!

  • reply
  • like

February 14, 2018 at 11:13am

Nice 😀 thanks

  • reply
  • like

Hey guys. Can anyone see my other thread problem here if this is about the messy code export of Figma or is it just about my incompetency on exporting SVGs?

https://spectrum.chat/thread/14b2d759-5e6c-4441-b75b-2e8d3aaeffa1

  • reply
  • like

Also any specific date or roadmap when this beta svg export improvements will be shipped?

  • reply
  • like
Your message here...

*bold*_italic_`code````codeblock```