How can I embed a SVG data uri in CSS using Stylus preprocessor without the SVG being Base64 encoded?
Like this:
background: url('data:image/svg+xml;utf8,<svg>[...]</svg>');
instead of this:
background: url('data:image/svg+xml;base64,PD94bWwg[...]');
Normaly I've used stylus.url()
to embed images, but it will also Base64 encode SVGs.
I want to use data uris instead of external files to save file requests. And I've realised that Base64 encoding SVGs actually adds bytes instead of reducing size.
I can't find a method to embed the SVG as-is.
inline-image()
, so that's what confused me. What would you call it? "embed"? – Renata