SVG in CSS broken
-
Hi, I love this plugin, but today it caused me some pain.
I am including small SVG’s in the CSS, but I don’t use base64, I encode only some characters, like advised here: https://codepen.io/tigt/post/optimizing-svgs-in-data-urisWithout autoptimize everything looks great, but autoptimize breaks gradients. Here is the code. Original encoded svg:
fill=’url(%23b)’
but autoptimize breaks it to:
fill=’url(//MY.HOST/wp-content/plugins/MYPLUGIN/%23b)’
and of course it doesn’t work – svg is corrupted. Just for completion, such fill is defined earlier as:
%3ClinearGradient id=’b’ …
As far as I understand the encoding proposed on the website mentioned by me is 100% legal (I mean – according to all standards) and the problem seems to be only with autoptimize.
Could you please take a look into it?
Once again – thank you for fantastic plugin and awesome support.
- The topic ‘SVG in CSS broken’ is closed to new replies.