Search code examples
csssvgadobe-illustratorsvgz

How to save as SVGZ with external stylesheets in Illustrator


I am trying to embed an external stylesheet in an svgz file. I can embed it just fine into the svg file but it seems to be stripped out when I save as svgz. Any help would be appreciated here is the code from the svg file:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">  
<?xml-stylesheet type="text/css" href="/assets/styles/stylesheets/web-fonts.css" ?>
<svg xmlns="http://www.w3.org/2000/svg">  

I am using Illustrator for saving out the files


Solution

  • I don't know whether SVGZ will work with CSS but SVGZ is a SVG compressed with GZIP.

    You can change SVG to SVGZ this way:

    1. get SVG file : example.svg
    2. remove extension .svg : example
    3. compress using GZIP : example.gz
    4. change extenson to .svgz : example.svgz