@function str-replace($string, $search, $replace: '') {
  $index: str-index($string, $search);
  @if $index {
    @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
  }
  @return $string;
}


$encoding-reference: (('<','%3C'),('>','%3E'),('"','\''),('#','%23'),('&','%26'));
@function svg-encode($svg) {
  @each $char, $encoded in $encoding-reference {
    $svg: str-replace($svg, $char, $encoded);
  }
  @return 'data:image/svg+xml,' + $svg;
}


@function svg-bg-uri($svg, $fill-color) {
    $returnSvg: str-replace($svg, $svgFillPH, $fill-color);
  @return svg-encode($returnSvg);
}