feathericons / elm-feather

Feather icons for elm
http://package.elm-lang.org/packages/1602/elm-feather/latest
BSD 3-Clause "New" or "Revised" License
76 stars 4 forks source link

Add a way to export Icon to Svg #18

Closed AlienKevin closed 3 years ago

AlienKevin commented 3 years ago

Most of the case, toHtml that exports Icon to Html works well. However, I have to follow the manual copy-and-paste route when embedding an Icon within Svg. Besides the inconvenience, this may also results in code duplication if I already imported the FeatherIcons library. Hope we can add a toSvg function to address this issue:

toSvg : List (Attribute msg) -> Icon -> Svg msg
AlienKevin commented 3 years ago

Nevermind, I just discovered that both Html and Svg are VirtualDom.Node so they can be used interchangeably in Elm.