From 5a63dbe31402f1460f7b99816e6136d4c8cd2f88 Mon Sep 17 00:00:00 2001 From: wooden-worm <93303706+wooden-worm@users.noreply.github.com> Date: Sat, 24 Aug 2024 12:30:10 -0700 Subject: [PATCH] Support `style` attribute (#54) * Support `style` attribute * Don't duplicate rsx! blocks Co-authored-by: Marc Espin * remove duplicated xlmns attribute --------- Co-authored-by: Marc Espin --- packages/lib/src/icon_component.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/lib/src/icon_component.rs b/packages/lib/src/icon_component.rs index 5d5a9e7..f85e7c2 100644 --- a/packages/lib/src/icon_component.rs +++ b/packages/lib/src/icon_component.rs @@ -35,6 +35,8 @@ pub struct IconProps { pub class: String, /// An accessible, short-text description for the icon. pub title: Option, + /// The style of the `` element. + pub style: Option, } /// Icon component which generates SVG elements @@ -44,6 +46,7 @@ pub fn Icon(props: IconProps) -> rsx!( svg { class: "{props.class}", + style: props.style, height: "{props.height}", width: "{props.width}", view_box: "{props.icon.view_box()}",