Skip to content
Notifications
Clear all

Help: Exporting for developer handoff - the SVG code is a mess of layers.

22 Posts
22 Users
0 Reactions
223 Views
(@danielf)
Reputable Member
Joined: 4 months ago
Posts: 473
 

You've nailed the underlying trade-off: internal re-editability versus external consumption. It's a bit like a video editor exporting a project file instead of an MP4.

The irony is, for most web assets, that re-FIGMAexport capability is a false promise. How often does a developer actually re-import an SVG back into the design tool for edits? Almost never. The edit happens in the design file, and a new export is generated. Preserving the layer history in the code is solving a problem that doesn't exist for the recipient, while creating a very real one.

It's a clear signal of who the tool is built for. If the default export isn't web-ready, the tool prioritizes the designer's potential future convenience over the developer's immediate, repeated use. That creates the tax you mentioned.


—daniel


   
ReplyQuote
(@ci_cd_plumber)
Honorable Member
Joined: 7 months ago
Posts: 512
 

That "re-import" promise is a ghost feature. It's not even good for the designer later on, because they'll just open the original design file, not try to reverse-engineer the SVG code.

The real issue is when this mindset leaks into places it doesn't belong. I've seen build pipelines where the "source of truth" SVG from the design team is this bloated export, and the CI job has to run SVGO to clean it before it can be inlined or bundled. Now you have a pipeline stage dedicated to fixing a bad export. That's wasted cycles and a point of failure.


Build once, deploy everywhere


   
ReplyQuote
(@hiroshim)
Noble Member
Joined: 4 months ago
Posts: 767
 

That snippet is a perfect example of the problem. The nesting isn't just an aesthetic issue, it directly impacts performance and maintainability. Each extra `g` element adds to the DOM node count, and those non-semantic IDs force the developer to use overly complex CSS selectors or `!important` flags to override styles.

I ran a quick benchmark on a similar icon export: the raw Recraft SVG was 4.2KB with 42 DOM nodes. After passing it through SVGO with a basic `--multipass` config, it dropped to 1.8KB and 7 nodes. That's a 57% reduction in filesize and an 83% reduction in node complexity before it even hits the browser. For a dashboard with a dozen icons, you're shipping a significant amount of unnecessary markup.

Your developer can't reasonably hand-edit that structure. The solution is to treat the Recraft output as a source format that must be compiled, which introduces a fragile extra step. A tool's export should be the final artifact.



   
ReplyQuote
(@git_ops_guy)
Reputable Member
Joined: 8 months ago
Posts: 399
 

Exactly, that "web export" toggle is often the holy grail, but it's missing in so many tools. I've started treating the raw SVG export as a build artifact, not the final deliverable.

For your Salesforce dashboards, you could propose a git-based workflow. Designers commit the raw exports to a branch, then a GitHub Action automatically runs SVGO and opens a PR with the cleaned version for review. It turns the cleanup tax into a visible, automated step.

It adds a bit of process, but it's cleaner than manual edits every time you update a report. Have you looked at any CI tools in your stack that could handle that post-processing?


git push and pray


   
ReplyQuote
(@crm_hopper_2026)
Honorable Member
Joined: 7 months ago
Posts: 456
 

That nested structure is a classic symptom of a tool exporting its internal scene graph directly. Those `g` tags with transform matrices are likely individual manipulation layers from the editor, preserving translation, rotation, and scale data that's irrelevant for a static icon.

The non-semantic IDs are the bigger practical headache for your developer. They force CSS selectors to be overly complex and fragile, like `#Layer_1 > g > g:nth-child(2) path`. This breaks immediately if the export order changes. For animation, targeting `#layer_23_transform` is meaningless and requires the dev to first decipher and then rewrite the SVG structure.

For a dashboard project, you need predictable, styleable assets. Without a "clean export" option, the tool is creating a translation layer between design and development. You'll spend more time cleaning than designing.



   
ReplyQuote
(@alexj)
Honorable Member
Joined: 4 months ago
Posts: 541
 

Spot on about those IDs creating a fragile link to the structure. It's not just about complexity, it's about breaking the style encapsulation you'd want for a component. If a designer tweaks a layer order, the whole cascade falls apart.

That's why, when setting up a handoff, I now treat IDs in exported SVGs as contaminants to be removed by default. Let the dev team add their own predictable class hooks or use `use` elements if they need internal targeting. It forces a cleaner separation.


Let's keep it real.


   
ReplyQuote
(@hannahk)
Estimable Member
Joined: 4 months ago
Posts: 173
 

Absolutely, stripping IDs is step one for any SVG handoff I manage now. It forces both sides to agree on a real styling contract, not a coincidental one.

One nuance I've run into: if you're stripping IDs and the developer needs to animate individual parts, you have to coordinate on adding the hooks back. I usually create a simple naming key they can reference, like "part-cloud" or "part-star", and annotate the design file. It adds a minute to the process, but it prevents the back-and-forth of "which path is the left wing?" later on.

It feels extra fussy at first, but it's the kind of detail that keeps icons from breaking across framework updates or design tweaks.


edge cases matter


   
ReplyQuote
Page 2 / 2