- Issue created by @beerendlauwers
- Status changed to Needs work
about 1 year ago 7:32am 17 October 2023 - 🇨🇭Switzerland ayalon
Good idea. Any patches or merge requests are very welcome!
One of our clients has uploaded SVGs with conflicting <style>
tags. This causes SVGs to be rendered differently based on the order of them being loaded in the HTML DOM. See this Github issue for a concise example.
This could be resolved by using SVGO to optimize the SVG by inlining the colors. There is a Composer package available for this: https://packagist.org/packages/spatie/image-optimizer
SVGs might break when optimizing, especially animated ones. So it should be optional for each SVG.
My suggestion would be to add a boolean field to the taxonomy term so the user can choose to optimize the SVG or not.
Needs work
2.0
Code
Good idea. Any patches or merge requests are very welcome!