Closed tad-lispy closed 5 years ago
Thanks for spotting and investigating. This is indeed a bug, which has been recently introduced because of api change in dependency feather-icons
(npm package) which has been used to generate this package, which now works like this:
node
> require('feather-icons').icons['feather'].toSvg()
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-feather"><path d="M20.24 12.24a6 6 0 0 0-8.49-8.49L5 10.5V19h8.5z"></path><line x1="16" y1="8" x2="2" y2="22"></line><line x1="17.5" y1="15" x2="9" y2="15"></line></svg>'
Solution that you've suggested should solve an issue, and in order to do so I need to amend generator for this to cope with upstream library API change.
Try inspecting the DOM of the icon here: https://ellie-app.com/4hJYQY82WJQa1 It looks something like:
I think it's because every icon contains
Svg.svg
element with fixed set of attributes (e.g.width
andheight
) e.g.feather
herehttps://github.com/feathericons/elm-feather/blob/f64d398e3140c7e93075d38305937d15f7bf6835/src/FeatherIcons.elm#L1398-L1402
Then
makeBuilder
puts it in thesrc
field of the record tagged byIcon
constructor:https://github.com/feathericons/elm-feather/blob/f64d398e3140c7e93075d38305937d15f7bf6835/src/FeatherIcons.elm#L224-L226
Finally
toHtml
wraps it inSvg.svg
againhttps://github.com/feathericons/elm-feather/blob/f64d398e3140c7e93075d38305937d15f7bf6835/src/FeatherIcons.elm#L214-L216
Probably a solution could be to change each icons' definition to only contain a list of paths, unwrapped from the SVG element, like this: