carloskiki / leptos-icons

An icon library for the leptos web framework
MIT License
84 stars 16 forks source link

Implement From of each of the icon types for MaybeSignal<Icon> #22

Closed SleeplessOne1917 closed 9 months ago

SleeplessOne1917 commented 9 months ago

I tried something like this for the icondata crate not long ago and was told that that crate was supposed to be framework agnostic. This seems like the more appropriate repo for that change.

I was having trouble getting the icon! macro to work. While that would solve the issues I'm having, I noticed that using Icon::From worked as well. If From is implemented on the icon types, it should allow consumers of the library to pass their directly to the icon component, making the icon! macro superfluous.

I'm willing to implement this change. @Carlosted Are the features generated programmatically for this crate like they are for the icondata crate?

carloskiki commented 9 months ago

I tried something like this for the icondata crate not long ago and was told that that crate was supposed to be framework agnostic. This seems like the more appropriate repo for that change.

Yes this is the right place to implement this feature!

I was having trouble getting the icon! macro to work. While that would solve the issues I'm having, I noticed that using Icon::From worked as well. If From is implemented on the icon types, it should allow consumers of the library to pass their directly to the icon component, making the icon! macro superfluous.

It would indeed be great if we find a way to remove the icon! macro for something better.

I'm willing to implement this change. @Carlosted Are the features generated programmatically for this crate like they are for the icondata crate?

I have not found enough time recently to work on a cli for this, but the features are generated programmatically in the boilerplate folder of the icondata repo.

I should be able to take a look at your PR (#23) later today.

carloskiki commented 9 months ago

Let me know if you need help with the icon! macro.