carloskiki / leptos-icons

An icon library for the leptos web framework
MIT License
95 stars 22 forks source link

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

Closed SleeplessOne1917 closed 1 year ago

SleeplessOne1917 commented 1 year 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 1 year 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 1 year ago

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