-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inline SVG gets spacing removed #25
Comments
@futtta I tried out your potential fix, it appears to only cover a subset of the SVG cases. I ran into the space stripping problem with My initial thought is to update your change to be:
|
thanks @josephscott; got some example code of how svg+xml would be embedded in CSS? |
@futtta sure, something like this:
The spaces between attributes were being removed. The change I proposed above has preserved them in my test cases so far. |
as per suggested by Joseph Scott, cfr. tubalmartin/YUI-CSS-compressor-PHP-port#25 (comment)
Makes sense, committed in my fork and in Autoptimize. Thanks @josephscott |
wrongfully closed, this is @tubalmartin 's bug to fix :-) |
Thank you for reporting and sorry for the delay. I have a fix for this one. Already tested. I'll make a release this week. Stay tuned ;) |
Fixed in v2.4.8-p7 release. Thank you guys! |
Reported in the Autoptimize support forum & confirmed using the YUI-CSS-compressor's GUI: when optimizing CSS with inlined SVG, the spaces get removed from the inline SVG;
a#mobile-menu-btn{ background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="9.125" height="9.137" viewBox="4.437 4.431 9.125 9.137"><path d="M9.282 8.712h4.125c.12 0 .155.047.155.168v.252c0 .12-.035.154-.155.154H9.282v4.127c0 .12-.036.155-.156.155h-.252c-.12 0-.156-.037-.156-.156V9.286H4.593c-.12 0-.156-.035-.156-.154V8.88c0-.12.036-.168.156-.168h4.125V4.585c0-.107.037-.154.156-.154h.252c.12 0 .156.05.156.156v4.126z"/></svg>') 0 0 no-repeat; }
becomes:
a#mobile-menu-btn{ background: url('data:image/svg+xml;utf8,<svgxmlns="http://www.w3.org/2000/svg"width="9.125"height="9.137"viewBox="4.4374.4319.1259.137"><pathd="M9.2828.712h4.125c.120.155.047.155.168v.252c0.12-.035.154-.155.154H9.282v4.127c0.12-.036.155-.156.155h-.252c-.120-.156-.037-.156-.156V9.286H4.593c-.120-.156-.035-.156-.154V8.88c0-.12.036-.168.156-.168h4.125V4.585c0-.107.037-.154.156-.154h.252c.120.156.05.156.156v4.126z"/></svg>') 0 0 no-repeat; }
Had a quick look at the source code, but haven't found a potential fix yet.
frank
The text was updated successfully, but these errors were encountered: