CSS Minify Option Breaks inline SVG XML #6822
Labels
Area: Frontend
bug report
Fixed in 2.2.x
The issue has been fixed in 2.2 release line
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
Preconditions
Steps to reproduce
background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" viewBox="0 0 38 40"><style>.st0{fill:none;stroke:%23ffffff;stroke-width:2;stroke-linecap:round;stroke-miterlimit:10;}</style><circle cx="14.7" cy="14.7" r="13.7" class="st0"/><path d="M23.9 24.7L37 39" class="st0"/></svg>') no-repeat left center;
(Note that Colors with hex values need # to be url encoded to %23 to not break firefox and safari)
Expected result
background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" viewBox="0 0 38 40"><style>.st0{fill:none;stroke:%23ffffff;stroke-width:2;stroke-linecap:round;stroke-miterlimit:10;}</style><circle cx="14.7" cy="14.7" r="13.7" class="st0"/><path d="M23.9 24.7L37 39" class="st0"/></svg>') no-repeat left center;
Actual result
Spaces are removed that should not be removed (marked in bold below)...
background:url('data:image/svg+xml;utf8,<svgxmlns="http://www.w3.org/2000/svg"id="Layer_1"viewBox="**003840**"><style>.st0{fill:none;stroke:%23ffffff;stroke-width:2;stroke-linecap:round;stroke-miterlimit:10;}</style><circlecx="14.7"cy="14.7"r="13.7"class="st0"/><pathd="**M23.924.7L3739**"class="st0"/></svg>') no-repeat left center;
There is a similar example here with other css minify libraries:
yui/yuicompressor#141
I'd like to be able to use inline svgs as background images to reduce http requests.
For now I've just changed them to use svg files in the meantime...
The text was updated successfully, but these errors were encountered: