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

Add support for Phosphor Icons #41

Closed
Michoels opened this issue Dec 13, 2024 · 6 comments
Closed

Add support for Phosphor Icons #41

Michoels opened this issue Dec 13, 2024 · 6 comments

Comments

@Michoels
Copy link

Phosphor Icons is a fantastic free icon set with over 9,072 icons.
It's my go-to library due to its vast size, uniform quality, and regular updates.

The core library of all 9K icons (across all 5 weights) is here.

While there already is a 3rd party gem, it would be great if this project could add support.

I'd be happy to help out with this.

@eelcoj
Copy link
Collaborator

eelcoj commented Dec 13, 2024

@Michoels Coincidence, started this PR yesterday #40 🙌

@eelcoj eelcoj closed this as completed Dec 13, 2024
@Michoels
Copy link
Author

Fantastic!
Looking forward.

@eelcoj
Copy link
Collaborator

eelcoj commented Dec 13, 2024

If you have thoughts/ideas on the task for “filename normalization”, I'm all ears!

@Michoels
Copy link
Author

Off the top of my head, there are probably two main approaches:

  1. Rename the files at download time (requires customizing the download system)
  2. Rewriting the user's requested icon name at runtime (requires customizing the runtime helper)

Which is better?
That depends on the internals of this gem, but my gut feeling is to go with (1) because I'd sooner have a custom downloader (runs once) then a custom helper (runs thousands of times per user on the render process). The risk is a failed download, and not failing a view render in real time.

@eelcoj
Copy link
Collaborator

eelcoj commented Dec 13, 2024

For sure on download is the moment. Currently it simply moves the icons from the cloned repo to the library. That's likely where any file -transformation can be done.

@Michoels
Copy link
Author

In the past, I've architected systems like this by mimicking the ActiveRecord hooks API: before_move, around_move, after_move.

The icon library adaptors can then hook in to whatever they need.

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

No branches or pull requests

2 participants