![]() I am also pasting below some other subtasks that will do an ID cleanup (recommended). The below grunt task will take care of that and make it class="tree". This will be exported by Illustrator as id="class="tree"". In Illustrator, declare the layer/object name as class="tree" for example. By using "grunt-text-replace" I am able to pass my minified SVGs (svgmin) through a custom regular expression that replaces all garbled class references with proper classes. I'd recommend reading over Wikimedia user Quibik's document on cleaning up SVG files by hand and taking a look at grunt-svgmin. Hand-written code tends to be lighter and easier for humans to read (if that's what you're going for). I'd also note that generated code is never going to be quite perfect for all situations. According to Add a hyperlink within Illustrator I followed those steps but I cannot get hyperlinks work in browsers. The linked page states this, but for the sake of completeness, Illustrator will only generate the style element and classes if you set CSS Properties: Style Element in the Advanced area (you might need to click More Options) of the SVG Options Dialog: Illustrator exported svg does not contain defined hyperlinks. Depending on what you want those classes to do, you could just define them in another CSS file and remove the style definitions from the exported SVG. This is how you can generate classes in your exported SVG. ![]() Illustrator can export graphic styles as CSS in a style element and applies them via classes in the SVG code. ![]() Here is the SVG output generated by Illustrator CC: It will declare sandStyle and blueSky as CSS styles in the SVG document. In the SVG export options, I select Style Elements, and I select the Include Unused Graphic Styles option. Looks like the link Ian Dunn posted might be your ticket.
0 Comments
Leave a Reply. |