SVG Export ignores layer id <g> tag for some artboards and layers, but not all of them
When exporting to SVG, some tags are ignored and some are not for the same document and export event.
I tried reproducing the problem and were successful.
Also, I tried fixing the problem and were, in a sense, successful.
Fixed it using the assets option on the export panel: it creates 2 layers <g> tags. One of them has the correct naming (stroke) and the other is just generic (Layer_2). The compiler put stroke inside layer_2. Not good for my automation process and where did layer_2 come from? I did not create it.
Another fix is to save the artboard as a separate file, but that is crazy as it comes with a ton of unnecessary code and when working with multiple artboards, this turns into caos.
But when exporting as artoboard, the layer named (stroke) is ignored and not put into the final svg. The path id is preserved, but thats it.
So, something is wrong with the ids and objects naming or maybe just the export tool. I dont know what or why its ignoring the layer id for some artwork and not all artwork.
We have the fix available in the latest release. Please update Illustrator using Adobe Creative Cloud application to the latest build for version Illustrator CC 23.0.
Please refer to our knowledge base FAQ – https://illustrator.uservoice.com/knowledgebase/articles/1844590 if you face difficulty in update.
Or get in touch with us at any of the other support channels – https://helpx.adobe.com/support.html
Ashutosh Chaturvedi | Sr. Quality Engineering Manager – Illustrator
Adobe. Make It an Experience.
Jumping in to say this is a weird bug and frustrating.
With the ability of many platforms to import the svg code from the svg file, control and flexibility with class names embedded in the svg would be HUGE for us who want to style the svgs on the fly in CSS.