Skip to content
This repository has been archived by the owner on Jul 19, 2020. It is now read-only.

6-8 Styling page, Move Nested components page #87

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@
* [Lists](concepts/html/lists.md)
* [Elements](concepts/html/elements.md)
* [Literals & Expressions](concepts/html/literals-and-expressions.md)
* [Components](concepts/html/components.md)
* [Components](concepts/components/README.md)
* [Internal State](concepts/components/internalstate.md)
* [Trap events](concepts/components/trapevents.md)
* [Properties](concepts/components/properties.md)
* [Callbacks](concepts/components/callbacks.md)
* [Emit events](concepts/components/emitevents.md)
* [Nested component](concepts/components/nestedcomponents.md)
* [Refs](concepts/components/refs.md)
* [Styling](concepts/components/styling.md)
* [Life cycle](concepts/components/lifecycle.md)
Copy link
Contributor

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."

Copy link
Author

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

* [Callbacks](concepts/components/callbacks.md)
* [Agents](concepts/agents.md)
* [Services](concepts/services/README.md)
* [Format](concepts/services/format.md)
Expand All @@ -36,9 +41,7 @@

## More

* [CSS](more/css.md)
* [Roadmap](more/roadmap.md)
* [Testing](more/testing.md)
* [Debugging](more/debugging.md)
* [External Libs](more/external-libs.md)

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Nested component
rlasjunies marked this conversation as resolved.
Show resolved Hide resolved
---
description: Create complex layouts with component hierarchies
---
Expand Down
36 changes: 36 additions & 0 deletions src/concepts/components/styling.md
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:
Copy link
Contributor

Choose a reason for hiding this comment

The 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 class attribute."

Copy link
Author

Choose a reason for hiding this comment

The 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
=> I remove the chapter


```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>
}
...
```
6 changes: 0 additions & 6 deletions src/more/css.md

This file was deleted.