Props like stroke-width
are not passed down to svg
element's children
#49
Labels
wontfix
This will not be worked on
Issue description
Props passed to
Icon
are only applied to the "top-level"svg
element but not its children. I noticed this while working w/ Tabler icons. For example, when I tellIcon
to use a stroke width of 1 and to use the color red, the emittedsvg
element shows both those properties but they're ignored by the containedpath
element. (See example below.)I don't know whether that's by design but I was expecting my settings being passed down the chain. I understand that might not always be desirable, especially when it comes to multi-color SVGs etc. But is there a way to force the props down to the
path
etc.? If not, might such functionality (hidden behind a toggle) be a useful addition to astro-icon?Possible way to do it: iterate over children, filter their attributes for those that correlate w/ a passed-in prop and replace those.
Input
Expected output
Note: I've sorted the attributes for easier visual scanning.
Actual output
Note: I've sorted the attributes for easier visual scanning.
The text was updated successfully, but these errors were encountered: