I have an scss mixin that applies a color to an svg dynamically:
$someColor: #ff3300;
@include successCheck($someColor);
@mixin successCheck($colour) {
background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 -46 417.813 417" xmlns="http://www.w3.org/2000/svg"><path fill="#{$colour}" d="M159.988 318.582c-3.988 4.012-9.43 6.25-15.082 6.25s-11.094-2.238-15.082-6.25L9.375 198.113c-12.5-12.5-12.5-32.77 0-45.246l15.082-15.086c12.504-12.5 32.75-12.5 45.25 0l75.2 75.203L348.104 9.781c12.504-12.5 32.77-12.5 45.25 0l15.082 15.086c12.5 12.5 12.5 32.766 0 45.246zm0 0"/></svg>');
}
the problem I'm seeing is that the color passed through is a hex value (#ff3300) and in the background-image data url the # is causing a problem, because in the data url it should be %23. I can't modify the orginal scss variable, since it is used elsewhere as a regular color.
I did try string-slice($color, 1) to remove the #, but this did not work. Is it possible to pass a hex color as a variable to an svg background image?