From 983e85728a21f0443f1ef0eb02b5da81c54b5ed4 Mon Sep 17 00:00:00 2001 From: luoxiao Date: Wed, 24 Apr 2024 11:12:49 +0800 Subject: [PATCH] fix: Icon inline-block --- thaw/src/icon/icon.css | 3 +++ thaw/src/icon/mod.rs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 thaw/src/icon/icon.css diff --git a/thaw/src/icon/icon.css b/thaw/src/icon/icon.css new file mode 100644 index 0000000..f941790 --- /dev/null +++ b/thaw/src/icon/icon.css @@ -0,0 +1,3 @@ +.thaw-icon { + display: inline-block; +} \ No newline at end of file diff --git a/thaw/src/icon/mod.rs b/thaw/src/icon/mod.rs index 3bb6fc1..2e6d588 100644 --- a/thaw/src/icon/mod.rs +++ b/thaw/src/icon/mod.rs @@ -1,6 +1,7 @@ // copy https://github.com/Carlosted/leptos-icons // leptos updated version causes leptos_icons error use leptos::*; +use thaw_utils::{class_list, mount_style}; /// The Icon component. #[component] @@ -24,6 +25,8 @@ pub fn Icon( #[prop(optional, into)] on_click: Option>, ) -> impl IntoView { + mount_style("icon", include_str!("./icon.css")); + let icon_style = RwSignal::new(None); let icon_x = RwSignal::new(None); let icon_y = RwSignal::new(None); @@ -79,7 +82,7 @@ pub fn Icon( view! {