Illustrator-Layer-Exporter
Illustrator-Layer-Exporter copied to clipboard
Different class names for multiple SVG styles
Hey there! I'm using this plugin to export a bunch of SVG elements and then importing them with document.importNode to an html document. When the SVGs get exported with the plugin, they all get the same class names like "st0" and "st1", so when I use them all together, it applies the last imported node's styles to everything. I was wondering if there was a fix for this.
Thanks!
Hi, unfortunately this is how Illustrator works and I have no control on that when using the style "elements" location option. However, I could expose this location option to give users the ability to inline styles. Adding to the backlog. Thanks for reporting
I have similar issue when combining the resulting SVG files as a sprite, and thus the last st styles become used.
Would it be possible to randomly generate the class name?
Tried with 2.1.0 dev version and using the CSS option attributes fixed my issue.
Still, perhaps adding a checkbox for the second option, style, for randomize class names, so the resulting SVG files would have some 10 characters long random class names.
Hi. Indeed this is fixed with 2.1, available in the dev branch. You can use it via the ZXP right now, or you can wait for me to merge to the master and re-publish on exchange. Unfortunately, I don't have access to generated style names (they are generated by Illustrator). The only way for me to fix this would be to post process SVG, which is something I've had in mind for quite some time but is still science fiction as we speak.