@classicmike/sass-svg-uri
v1.0.0
Published
Sass function to encode SVG as a data uri without it being in base64. This package is a fork of the original sass-svg-to-uri package by waldemarfm. It replaces support original SASS implementation for the new SASS implementation
Downloads
666
Readme
SASS SVG URI
Description
NOTE: This is NOT my original work.
The intention of this repo is to port the original waldemarfm/sass-svg-uri to be supported in the Dart SASS implementation without it outputting any warnings and errors. The original repo is no longer being maintained from my understanding. Last commit was around 2015.
So what if I need to support SASS implementations before Dart SASS?
If you are after support for node-sass or SASS implementations before the Dart SASS implementation, please follow the link over here for the original waldemarfm/sass-svg-uri repository and the original sass-svg-uri npm package.
Original Description Text
This is just a simple module with Jakob Eriksen's function for easy use in projects. Uses Hugo Giraudel's str-replace function to replace invalid characters in the SVG as a data uri.
Usage
Just import the file and use the function, no dependencies.
@import "@classicmike/sass-svg-uri/svg-uri";
.icon {
background-image: svg-uri('<svg xmlns="http://www.w3.org/2000/svg"> ... </svg>');
}
Would output:
.icon {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E% ... %3C/svg%3E");
}
To know more: