tailwindlabs / heroicons

A set of free MIT-licensed high-quality SVG icons for UI development.
https://heroicons.com
MIT License
21.04k stars 1.26k forks source link

Implement Hex.pm package for Heroicons #718

Closed morinap closed 1 year ago

morinap commented 1 year ago

This pull request implements an Elixir module for serving up phoenix HTML-safe content for each heroicon SVG. This package could be built and pushed to hex.pm and then installed in any elixir project for rendering heroicon SVGs. Builder/maintainer of the package is TBD if this PR is approved.

To test, add the following dependency to an Elixir project:

{:phoenix_heroicons, git: "https://github.com/morinap/heroicons", branch: "elixir-icons"},

Then, within any template, render an icon like this:

<%= PhoenixHeroicons.svg("solid/thumb-up", class: "h-6 w-6 text-green-400") %>
adamwathan commented 1 year ago

Hey thank you so much! I think for now this would best be handled as a third-party package, just because I don't want to commit to maintaining this ourselves going forward as none of the maintainers actively use Elixir. Better for someone who would actually be using it to publish their own package and share it with the community, then it will actually be properly maintained 👍🏻

Sorry, hope that's understandable and thanks again regardless, really appreciate it.

morinap commented 1 year ago

@adamwathan No worries, I appreciate it. I'll spin this off into its own repo and build a package myself for publication then; there's enough users of Tailwind in Phoenix projects that I think it would get some installers.