some refractoring

This commit is contained in:
2024-11-25 03:10:28 +01:00
parent 33843688d8
commit f8fd990c67
9 changed files with 370 additions and 343 deletions
+9 -7
View File
@@ -1,21 +1,23 @@
use crate::prelude::*;
pub fn event_logger() -> Element {
pub fn examples() -> Element {
rsx! {
styling: Some(styling()),
button { class: "txt", "Hello, World!" }
if (2 == 2) {
rsx_elem! { button { class: "btn", "Hello, World!" } }
}
}
}
pub fn styling() -> Css {
css! {
.txt {
x: Center,
y: Center,
.btn {
x: 30%,
y: Auto,
color: Red,
}
.txt: clicked {
.btn: clicked {
color: Blue,
}
}