- First commit to issue fork.
- 🇪🇸Spain frouco
Here is patch to make this proof of concept applicable to >1.5.0 versions
- 🇪🇸Spain frouco
This solution is not really necessary.
The way to apply colours to elements inside the SVG with
use
is with CSS custom properties (variables)..svg example
<svg> <defs> <symbol id="icon-id" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle style="fill: var(--icon-bg, none);" fill="none" cx="15" cy="15" r="15"/> <path style="fill: var(--icon-ring, currentColor);" fill="currentColor" d="M15 2.5a12.5 12.5 0 1 1 0 25 12.5 12.5 0 0 1 0-25ZM15 0a15 15 0 1 0 0 30 15 15 0 0 0 0-30Z"/> <path style="fill: var(--icon-figure, currentColor);" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M20.29 8.88c-2.5-.17-8.08-.17-10.58 0-2.7.18-3.02 1.82-3.04 6.12.02 4.3.33 5.94 3.04 6.12 2.5.17 8.08.17 10.58 0 2.7-.18 3.02-1.82 3.04-6.12-.02-4.3-.33-5.94-3.04-6.12Zm-1.82 6.11-5.97-2.77v5.56l5.97-2.79Z" /> </symbol> </defs> </svg>
CSS code example
svg { --icon-bg: currentcolor; --icon-ring: red; --icon-figure: #fff; }
- 🇪🇸Spain idiaz.roncero Madrid
That's a really clever solution. I guess browser support is the same as CSS custom properties?