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
Communication Examples Style and Code Clean-up #3180
Communication Examples Style and Code Clean-up #3180
Conversation
- Rounded - Cursor change - Hover colour
Size Comparison
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the separation of parent and child components into separate modules, as would be done in the real world. But I don't think this is the right place to introduce Tailwind as it bloats the HTML in what needs to be simple component examples.
Don't get me wrong, I love Tailwind, but I think it's probably a better idea to create a separate example on using Tailwind with Yew. Perhaps you could create an assortment of examples for using different css libraries 🙂
P.S. Approved by accident before, apologies.
I'm on the other side of things in believing it should be the way to do things, my case is that it:
It would be ideal to have custom classes written in raw CSS, but it would take a lot more time to create and also might end up looking subpar such as how these examples look at the moment without the changes this PR makes. Overall I believe this to be a worthwhile trade-off - if someone is attempting to use the Yew framework, it would be likely for them to be familiar with CSS libraries such as Tailwind; even if they were not familiar, the extra text this adds to the HTML is not difficult to understand so long as you know what a class is in general, it also does not affect the core demonstration of the example. If the viewer doesn't properly understand HTML structure then I'm guessing they should probably be starting with stuff a bit more basic than Yew. The time that developers spend on generating these examples and making contributions to Yew should be an important thing to consider, Tailwind offers the best of both worlds in terms of style and fast development. |
Speed of development is important, although I still think the priority of these examples should be simplicity over anything else. IMO there are fundamentally different priorities between creating examples that prove a basic concept and building an entire project. But I'm not a maintainer of this repo ¯_(ツ)_/¯ |
I would agree with @tobyscott25's opinion that we should keep the examples as simple as possible. Using local styles also makes it possible to run these examples offline without bundling tailwind. |
I've refactored out Tailwind and readded the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the pull request! Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice work
Description
This PR aims to improve the styling and code layout of the following examples:
communication_child_to_parent
- Child to Parentcommunication_grandchild_with_grandparent
- Grandchild with Grandparentcommunication_grandparent_to_grandchild
- Grandparent to Grandchildcommunication_parent_to_child
- Parent to ChildFeel free to provide me with any feedback you have on these changes.
Checklist
communication_child_to_parent
communication_grandchild_with_grandparent
communication_grandparent_to_grandchild
communication_parent_to_child
The checklist item for additional tests has been omitted as they are not necessary in this situation.
Reasoning
The examples
README.md
mentions any help with styling would be appreciated; I thought it would be a good idea to start churning through some examples to make things look nicer. 😃Before/After of Examples
Child to Parent
Before
After
Grandparent with Grandchild
Before
After
Grandparent to Grandchild
Before
After
Parent to Child
Before
After