From f753a27bbc991e5beb2becb34ea048436390c3c6 Mon Sep 17 00:00:00 2001 From: Leo dev Date: Sat, 14 Dec 2024 22:36:23 +0100 Subject: [PATCH] test --- src/examples.rs | 15 +++++++++++++++ src/rsx.rs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/examples.rs b/src/examples.rs index 5b5d468..4185172 100644 --- a/src/examples.rs +++ b/src/examples.rs @@ -4,6 +4,8 @@ pub fn todo_app() -> Element { let todo = vec!["Foo", "Bar"]; rsx! { + // text { class: "title", "Todo list app made with OSUI" } + // text { class: "title", "{}", "-".repeat(crossterm::terminal::size().unwrap().0 as usize) } for (t in todo) { ersx!( button{ class: "todo", on_click: fn(btn: &mut Button, _, _) { btn.class = if btn.class == "todo" { @@ -23,10 +25,23 @@ pub fn todo_styling() -> Css { y: Auto, color: Red, } + "todo": "hover" { + color: Blue + } "complete" { x: 0 px, y: Auto, color: Green, } + "complete": "hover" { + color: Cyan + } + "title" { + x: 0 px, + y: Auto, + } + "title": "hover" { + color: Blue + } } } diff --git a/src/rsx.rs b/src/rsx.rs index cea619f..0f6fd80 100644 --- a/src/rsx.rs +++ b/src/rsx.rs @@ -82,7 +82,7 @@ macro_rules! parse_rsx_param { }; ($elem:expr, $text:expr, $($inner:tt)*) => { - $elem.children.set_text_force(&format!($text, $($inner)*)) + $elem.children.set_text_force(std::sync::Arc::new(move || format!($text, $($inner)*))) }; ($elem:expr, ) => {};