reworkcss / rework-plugin-url

url() plugin for rework, formerly included in core

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non base64 Data URls

rmaspero opened this issue · comments

With SVG's it is often more efficient not to base64 them and just have them in a data url like:

background-image: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2344ce79' fill-opacity='0.4'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");

However the plugin strips all single quotes from the string which means the images can't be rendered atm.

Is that the same as #7, which might be addressed by #10?

Since there are no commits on this repo since 2015 I do not think it is maintained any longer. So don't get your hopes up that any PRs will be merged.

After using a forked version for a little while I ended up switching to use PostCSS Url which is still maintained. If you are already using the popular Autoprefixer then you are also using PostCSS which makes adding PostCSS Url pretty easy.