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 ...

Get Sams Teach Yourself SVG in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.