Skip to content

Commit 439082b

Browse files
authored
Merge pull request #241 from element-hq/button-icon-size
Use the correct icon size on large icon buttons
2 parents ab86e5b + 4d69c9c commit 439082b

11 files changed

+4
-2
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

src/components/Button/Button.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ export const Button = forwardRef(function Button<
9898
[styles.destructive]: destructive,
9999
});
100100

101+
const iconSize = iconOnly && size === "lg" ? 24 : 20;
102+
101103
return (
102104
<UnstyledButton
103105
{...props}
@@ -111,8 +113,8 @@ export const Button = forwardRef(function Button<
111113
>
112114
{Icon && (
113115
<Icon
114-
width={20}
115-
height={20}
116+
width={iconSize}
117+
height={iconSize}
116118
className={styles.icon}
117119
aria-hidden={true}
118120
/>

0 commit comments

Comments
 (0)