Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: mount optimized icons #5

Open
rhcarvalho opened this issue Jun 15, 2023 · 1 comment · May be fixed by #6
Open

Suggestion: mount optimized icons #5

rhcarvalho opened this issue Jun 15, 2023 · 1 comment · May be fixed by #6

Comments

@rhcarvalho
Copy link

I was looking at what gets published to NPM, and seems that their build script takes input from src and output to optimize, then copying the result to top-level directories and releasing that.

https://github.com/tailwindlabs/heroicons/blob/eee05eb77af6cdedfb97f128d1998773fc984b28/package.json#L17-L19

In my project I changed the mount point to use the optimized version of the icons:

  [[module.imports]]
    path="github.com/tailwindlabs/heroicons"
  [[module.imports.mounts]]
    source = "optimized"
    target = "assets/svg/heroicons"

Among other benefits, this allows for easier control of icon size using CSS. Example:

{{ $icon := resources.Get "svg/heroicons/20/solid/phone.svg" }}
<span class="w-8 h-auto">{{ $icon.Content | safeHTML }}</span>
@bep
Copy link
Member

bep commented Jun 15, 2023

I agree we should do that. I originally created this repo as a proof of concept for module usage, but I haven't followed up on this. A pull request would be appreciated and merged.

@rhcarvalho rhcarvalho linked a pull request Jun 26, 2023 that will close this issue
@Heyitsquoracom Heyitsquoracom mentioned this issue Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants