I'm trying make an SVG color match the color of the surrounding text in a GitHub readme. (If setting the text to "fill=black"
, it'll hardly be visible in GitHub's dark mode.)
From here, I gather that I can use
fill="currentColor"
to get the color
property of the nearest (surrounding) CSS element. I tried that with an SVG that displays a simple circle:
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" baseProfile="full" viewBox="-500 -500 1000 1000">
<circle r="400" fill="currentColor" />
</svg>
The SVG is embedded in the README as
<p align="center">
<img src="https://nschloe.github.io/smoothfit/disk.svg" width="60%">
</p>
However, the fill color will always come out as black.
(From here).
Any idea what's going wrong?