Is it possible using pure CSS (no JS) to set set fill color of an inline SVG?
I have an element with some content and I need to
- Reset the content to a simple SVG image (basically a glyph)
- Dynamically reset the fill color of that SCG (not as an inline attribute on the SVG, as this color is coming from a CSS variable)
div {
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 10.586l5.293-5.293a1 1 0 011.414 1.414L13.414 12l5.293 5.293a1 1 0 01-1.414 1.414L12 13.414l-5.293 5.293a1 1 0 11-1.414-1.414L10.586 12 5.293 6.707a1 1 0 011.414-1.414L12 10.586z'/%3E%3C/svg%3E");
}
<div>Hello World<div>
Is it now possible to make this icon red?