Closed lrobeson closed 5 years ago
Yeah, all SVGs should have a height & width attribute in order for them to work as CSS background images.
I’m creating optional Gulp tasks for the Gesso theme which uses imagemin (svgo plugin) to minify the SVG images, which doesn’t remove the height & width attributes.
The
{ removeUselessStrokeAndFill: false }
part of the svgmin Grunt task config removes the width and height attributes in thepath
, which can cause the SVG to not render in Internet Explorer 11 (only on Windows 10, supposedly).For example:
Original code: `
After svgmin:
<svg id="icon_map" data-name="Icon Map" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 30"><defs><style>.cls-1{fill:#fff}.cls-2{fill:#63619a;fill-rule:evenodd}</style></defs><title>ViewIcons</title><path class="cls-1" d="M0 0h36v30H0z"/><path class="cls-2" d="M5.79,7.92a5.33..."/></svg>