base64 encoder for node-sass
Adding a base64 encoder function to node-sass is pretty straight-forward.
We’ll have to define a encodeBase64
function and pass it to sass compiler.
If you’re using gulp than it will look something like this:
The main bit here are lines 5-12 were we define options for SASS compiler. In SASS that can be used as
If you’re looking for a way to inline your images (svg, png, jpg…) into SASS then take a look at JosephClay/sass-inline-image.