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

Improve theme-switch examples #77

Open
simbleau opened this issue Jun 30, 2022 · 2 comments
Open

Improve theme-switch examples #77

simbleau opened this issue Jun 30, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@simbleau
Copy link
Contributor

simbleau commented Jun 30, 2022

I think stylist is honestly brilliant. Kudos. There isn't exactly an abundance of resources for Yew styling right now, so I'm just happy to see a great library in the space.

One of the more involved features of stylist is themeing.

I was able to largely get the theme-switch examples working in my project with only some minor headaches. But I'd really love to see it be documented better and simplified.

I'm wondering if PRs would be accepted - because I'd be happy to contribute.

As of now, some ideas I would contribute to a PR:

  • Documenting the examples. There are no comments/docs anywhere, leaving users to 'reverse engineer'.
  • Explain why one might use the context example over the hook for themeing on the examples' respective README's (One thing I was scratching my head at first).

And here's what I'd possibly simplify:

  • Remove the use of one_cell::sync::Lazy and yew::html::ImplicitClone. They are optimizations made and deserve to be either 1) documented or 2) removed as needless to the point of an example.
    I'd rather see 2.
@futursolo
Copy link
Owner

futursolo commented Jun 30, 2022

I'm wondering if PRs would be accepted - because I'd be happy to contribute.

Pull requests are always welcome.
We should eventually expand our documentation and include tutorials.

I haven't had time to add documentation to explain how to actually use the library.

Explain why one might use the context example over the hook for themeing on the examples' respective README's (One thing I was scratching my head at first).

There is not an official preference on whether you should use hooks or styled_component.
Some people may prefer hooks over procedural macro as it involves less magic.

The -context naming might not be the best choice here as -hooks example also uses context and -context also uses hooks (to read theme). The difference is that -hooks uses use_style! hook and -context uses styled_component procedural macro.

@simbleau
Copy link
Contributor Author

simbleau commented Jul 3, 2022

Thanks for clarifications here.
Edit: Busy lately, but will get to this. :)

@futursolo futursolo added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants