postcss / postcss-url

PostCSS plugin to rebase url(), inline or copy asset.
MIT License
377 stars 59 forks source link

Optimized SVG data URI #103

Closed nlemoine closed 7 years ago

nlemoine commented 7 years ago

While working on data URI with SVG, I stumbled upon this article: https://codepen.io/tigt/post/optimizing-svgs-in-data-uris

I noticed you already replaced encoded spaces with real spaces. SVG data URIs could be a little more optimized by replacing some encoded characters as suggested by the article: %3D, %3A, %2F and maybe %22.

These optimizations still provide a very decent browser support (IE 9+).

Let me know if I can help.

sergcen commented 7 years ago

@nlemoine it's can be useful, i'll add this improvement in next minor version

nlemoine commented 7 years ago

👍 Thanks for considering the request!

sergcen commented 7 years ago

added option optimizeSvgEncode option 7.1.0