some refreactoring
This commit is contained in:
+30
-10
@@ -19,18 +19,38 @@ pub fn examples() -> Element {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn styling() -> Css {
|
||||
css! {
|
||||
"btn" {
|
||||
outline: true,
|
||||
x: Center,
|
||||
y: Center,
|
||||
width: Auto,
|
||||
color: Red,
|
||||
pub fn todo_app() -> Element {
|
||||
rsx! {
|
||||
styling: Some(styling()),
|
||||
class: "root",
|
||||
div {
|
||||
class: "first",
|
||||
text { class: "title", "not started" }
|
||||
}
|
||||
div {
|
||||
class: "second",
|
||||
text { class: "title", "completed" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"btn": clicked {
|
||||
color: Blue,
|
||||
pub fn styling() -> Css {
|
||||
css! {
|
||||
"first" {
|
||||
x: Auto,
|
||||
y: 0 px,
|
||||
width: 50%,
|
||||
}
|
||||
"second" {
|
||||
x: Auto,
|
||||
y: 0 px,
|
||||
width: 50%,
|
||||
}
|
||||
"root" {
|
||||
width: 100%,
|
||||
}
|
||||
"title" {
|
||||
x: Center
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user