I have an SVG background image embedded in a CSS file as a data url:
.what { background: url('data: image/svg+xml; utf8, <svg> ... </svg') }
I want another element to have the same background image, only in a different color, but I don't want to repeat the whole SVG code.
<div class="what one">...</div>
<div class="what two">...</div>
So how do I change the color of a background SVG image?
No Javascript, please.
None of the other related questions answered this, because the solutions given there rely on serving two different files, which I want to avoid because I want to minimize file size for mobile users.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…