This repository has been archived by the owner on Jul 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
6-8 Styling page, Move Nested components page #87
Open
rlasjunies
wants to merge
6
commits into
yewstack:master
Choose a base branch
from
rlasjunies:nested-components
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e33917c
move nestedcomponent page to component
d930117
add styling and remove css
2fbe653
update summary with all the changes
e04dee3
update following teymour feedbacks
461f59b
update summary based on Teymour feedbacks
b73eb82
replace Trap events by Listen to
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/concepts/html/components.md → src/concepts/components/nestedcomponents.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Styling | ||
|
||
<Work in progress> | ||
|
||
Proposal for proper CSS support can be found here: [https://github.com/yewstack/yew/issues/533](https://github.com/yewstack/yew/issues/533) | ||
rlasjunies marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
In the meantime you can define the style with any standard CSS tools | ||
rlasjunies marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Yew component does not support yet class attribute | ||
|
||
So far Yew component does not support natively the `class` attribute. You can add the class attribute to your component: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gramatically this should read more along the lines of "At the moment Yew's components don't natively support the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand that this limitation is now resolved with the 0.16 release with #1187 |
||
|
||
```rust | ||
#[derive(Properties, Clone, PartialEq)] | ||
... | ||
pub struct Props{ | ||
... | ||
#[prop_or_default] | ||
pub class:String, | ||
rlasjunies marked this conversation as resolved.
Show resolved
Hide resolved
|
||
... | ||
} | ||
... | ||
``` | ||
|
||
and render how you wish! | ||
|
||
```rust | ||
... | ||
html! { | ||
<div class={format!("{}",self.props.class)}> | ||
<h1>{"I am super Class"}</h1> | ||
</div> | ||
} | ||
... | ||
``` |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Stylistically, I think it's better for "life cycle" to be "lifecycle."
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 ask myself about it and google it. Found more about "Life Cycle"
Anyway ... we are 2 having the same feeling => I change to 1 word