Context: I’m coming off years of Vue/React or otherwise JSX-like components when it comes to building front-ends, but years of Rails ERB templates before that :).
I’m importing an SVG with attribute stroke="#000" … I want to set that stroke to a different value.
In Vue, I’d do something like <my-svg-component stroke="red"> and it would override. I understand in Vue I’m dealing with something closer to a DOM object and not a mere template string.
Is there an equivalent to doing this in Hugo? I could also imagine adding class names to the outermost element of a partial import, etc.
Personally I would set the value to currentColor in the svg. That way it is reusable and trivial to change the colour by simply setting a colour value on the containing element, as the svg will just inherit that.
e.g: .my-icon_container {color: #f00;} also means you can .my-icon-container:hover, .my-icon-container:focus {color: 'hot pink'}.
Furthermore, applying #000 to an svg is not required, they are black by default.