File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,10 @@ pub trait IconShape {
21
21
pub struct IconProps < T : IconShape + Clone + PartialEq + ' static > {
22
22
/// The icon shape to use.
23
23
pub icon : T ,
24
- /// The height of the `<svg>` element. Defaults to 20.
25
- #[ props( default = 20 ) ]
26
- pub height : u32 ,
27
- /// The width of the `<svg>` element. Defaults to 20.
28
- #[ props( default = 20 ) ]
29
- pub width : u32 ,
24
+ /// The height of the `<svg>` element. Omitted by default.
25
+ pub height : Option < u32 > ,
26
+ /// The width of the `<svg>` element. Omitted by default.
27
+ pub width : Option < u32 > ,
30
28
/// The color to use for filling the icon. Defaults to "currentColor".
31
29
#[ props( default = "currentColor" . to_string( ) ) ]
32
30
pub fill : String ,
@@ -47,8 +45,8 @@ pub fn Icon<T: IconShape + Clone + PartialEq + 'static>(props: IconProps<T>) ->
47
45
svg {
48
46
class: "{props.class}" ,
49
47
style: props. style,
50
- height: "{ props.height}" ,
51
- width: "{ props.width}" ,
48
+ height: props. height. map ( |height| height . to_string ( ) ) ,
49
+ width: props. width. map ( |width| width . to_string ( ) ) ,
52
50
view_box: "{props.icon.view_box()}" ,
53
51
xmlns: "{props.icon.xmlns()}" ,
54
52
fill,
You can’t perform that action at this time.
0 commit comments