styling
This commit is contained in:
+16
-5
@@ -2,10 +2,21 @@ use crate::prelude::*;
|
||||
|
||||
pub fn event_logger() -> Element {
|
||||
rsx! {
|
||||
id: "root",
|
||||
text { on_event: Handler::new(|_, _, document| {
|
||||
let root = document.get_element_by_id::<Div>("root").unwrap();
|
||||
root.children.add_child(rsx_elem!( text { "Ok" } ));
|
||||
}), id: "txt", "current event: None" }
|
||||
styling: Some(styling()),
|
||||
button { class: "txt", "Hello, World!" }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn styling() -> Css {
|
||||
css! {
|
||||
.txt {
|
||||
x: Center,
|
||||
y: Center,
|
||||
color: Red,
|
||||
}
|
||||
|
||||
.txt: clicked {
|
||||
color: Blue,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user