In the next SCSS, I would like to use a variable fg-colorin an attribute url background-image.
$fg-color: #ff6464;
i.icon-back {
background-image: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 20'><path d='M10,0l2,2l-8,8l8,8l-2,2L0,10L10,0z' fill='%23ff6464'/></svg>");
}
At the moment, the value of the variable in is simply repeated inside the SVG line, for example:
fill='%23ff6464'
I would like this to automatically update whenever a variable is updated fg-color.
How can i do this?
UPDATE:
This SCSS input:
i.icon-back {
background-image: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 20'><path d='M10,0l2,2l-8,8l8,8l-2,2L0,10L10,0z' fill='$fg-color'/></svg>");
}
This CSS output:
i.icon-back {
background-image: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 20'><path d='M10,0l2,2l-8,8l8,8l-2,2L0,10L10,0z' fill='$fg-color'/></svg>");
}
... it's exactly the same - the variable is not being processed.
Note:
I examined these questions, which seem to be similar but not the same: