1

Looking at svg minimization options, I found svgo https://github.com/svg/svgo . I successfully tried it with svg generated from illustrator, however, when I run it against the following, the resulting file is completely blank.

<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">

  <symbol id="beaker" viewBox="214.7 0 182.6 792">
    <!-- <path>s and whatever other shapes in here -->  
  </symbol>

  <symbol id="shape-icon-2" viewBox="0 26 100 48">
    <!-- <path>s and whatever other shapes in here -->  
  </symbol>

</svg>

I haven't been able to find a reason why this occurs.

Sebastian Kreft
  • 7,819
  • 3
  • 24
  • 41
user3792159
  • 111
  • 2
  • 13

2 Answers2

2

style="display: none;"

This is causing SVGO to think you don't need the block which mean it will empty the entire file. I'm not sure how to prevent this either

zzarbi
  • 1,832
  • 3
  • 15
  • 29
1

It can be prevented by passing an option to the plugin removeHiddenElems, displayNone: false

Kevin
  • 11
  • 1