Currently, I am attempting to modify the color of an SVG that is displayed on various pages using the code
<svg id="logo-svg"><use xlink:href="#kmc-logo"></use></svg>
.
You can find the methods I have been experimenting with here: https://tympanus.net/codrops/2015/07/16/styling-svg-use-content-css/.
Below is a snippet of the SVG symbol
that I am importing:
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="kmc-logo" viewBox="0 0 151 151">
<g id="logo">
<g id="outer-circle">
<path fill="none" stroke-linecap="round" stroke-linejoin="round" d="M11.51 ..."/>
</g>
<g id="ceramics">
<path stroke="none" d="M39.47 ..."/>
</g>
</g>
</symbol>
</svg>
In my stylesheet, there is the following style:
#masthead > .content-width .site-branding .logo--white a #logo-svg {
fill: #fff;
stroke: #fff;
}
The stroke
color works correctly for the #outer-circle
, however, the fill does not work for the path within #ceramics
.
If anyone could provide insight into this issue, it would be greatly appreciated! Thank you in advance!
UPDATE: Following further investigation, I have modified this question as the problem seems to lie in styling elements within shadow-dom svgs.