stylus-inline-svg

Inline SVG as data uri without Base64 encoding

Usage no npm install needed!

<script type="module">
  import stylusInlineSvg from 'https://cdn.skypack.dev/stylus-inline-svg';
</script>

README

stylus-inline-svg

Wraps stylus.url() to inline SVG images as UTF8 instead of Base64. All other images are passed to the stylus.url() method.

var
    inlineSVG = require('stylus-inline-svg');

stylus(str)
    .set('filename', __dirname + '/css/test.styl')
    .define('url', inlineSVG({'paths': [__dirname + '/public']}))
    .render(function (err, css) {

    });