O'Reilly logo

Sams Teach Yourself SVG in 24 Hours by Micah Laaker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Style

Illustrator has a unique method of applying style to objects. When exporting SVG, Illustrator creates a series of styles beginning with st and ending in a sequentially building number. Though creating small style names shaves a number of bits off the file size, it also creates a problem for developers who are trying to understand what style names reference what style properties. Consider performing a global find & replace on your SVG document. Replace each st# instance with a more illustrative name.

For instance, if st7 fills an object with #336699, replace all instances of st7 with “Fill336699.” Be certain to start the find-and-replace task with the last style, as replacing st1 will catch both st1 and the first three characters of st10 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required