support/convert.js
function process (svg, { prefix }) {
  // Inject a <style> in the SVG document to allow changing colors
  svg = svg.replace(/<(path|circle) /gi, (_, tag) => `<${tag} fill="__COLOR__" `)

  // Since this is a data: URI, we want to encode it with %23 and such
  svg = encodeURIComponent(svg)

  // We want the #{...} interpolation to be outside the URI encoding
  svg = svg.replace(/__COLOR__/g, '#{' + prefix + '-fix-color($color)}')

  svg = 'data:image/svg+xml;charset=utf-8,' + svg

  return svg
}
function process (svg, { prefix }) {
  // Inject a <style> in the SVG document to allow changing colors
  svg = svg.replace(/<(path|circle) /gi, (_, tag) => `<${tag} fill="__COLOR__" `)

  // Since this is a data: URI, we want to encode it with %23 and such
  svg = encodeURIComponent(svg)

  // We want the #{...} interpolation to be outside the URI encoding
  svg = svg.replace(/__COLOR__/g, '#{' + prefix + '-fix-color($color)}')

  svg = 'data:image/svg+xml;charset=utf-8,' + svg

  return svg
}
function process ( svg , { prefix } ) { // Inject a <style> in the SVG document to allow changing colors svg = svg . replace ( / <(path|circle)  / gi , ( _ , tag ) => ` ${ tag } ` ) // Since this is a data: URI, we want to encode it with %23 and such svg = encodeURIComponent ( svg ) // We want the #{...} interpolation to be outside the URI encoding svg = svg . replace ( / __COLOR__ / g , '#{' + prefix + '-fix-color($color)}' ) svg = 'data:image/svg+xml;charset=utf-8,' + svg return svg }
Converts the SVG into a data URI.
@private
Converts the SVG into a data URI .