Skip to content

@TrySound TrySound released this Mar 28, 2021 · 4 commits to master since this release

Hey, everybody! We have a big release here.

  • The new plugin is added for merging style elements into one. See #1381

Before:

<svg>
  <style media="print">
    .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }
  </style>
  <style>
    .test { background: red; }
  </style>
</svg>

After:

<svg>
  <style>
    @media print{
      .st0{ fill:red; padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; }
    }
    .test { background: red; }
  </style>
</svg>
  • CLI got new --exclude flag which uses regexps to exclude some files from --folder. See #1409
svgo --folder=svgs --exclude "invalid-icon" "bad-.+"
  • Internal AST is migrated to XAST. This spec makes maintaining plugins easier and may be used as interop with other tools like SVGR.

  • The new visitor plugin type combines features of "full", "perItem" and "perItemReverse" plugins without loosing simplicity. Eventually only visitor api will be supported. See #1454

Also small fixes

  • override default floatPrecision in plugins with globally specified one (7389bcd)
  • fix rendering -0 in path data (3d4adb6)
  • make browser bundle 30% smaller (2799622)
  • simplified convertPathData plugin (a04b27a and 6165743)
  • prepared for more regression tests (d89d36e)

Thanks to @chambo-e, @strarsis, @XhmikosR, @omgovich and @TrySound

Assets 2