Skip to content

Commit bf14c23

Browse files
committed
fix(Button): icon size definition * 4
1 parent 851ce49 commit bf14c23

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/components/actions/Button/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const DEFAULT_BUTTON_STYLES: Styles = {
8787
'display .2s steps(1, start), margin .2s linear, opacity .2s linear',
8888
},
8989

90-
'& [data-element="ButtonIcon"]:not(:has(.tabler-icon))': {
90+
'& [data-element="ButtonIcon"]:has(.anticon)': {
9191
fontSize: '@icon-size',
9292
},
9393
};

src/icons/Icon.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ const IconElement = tasty({
2626
verticalAlign: 'sub',
2727
width: '1em 1em',
2828
height: 'min 1em',
29-
fontSize: 'var(--icon-size, var(--font-size))',
29+
fontSize: {
30+
// legacy icons
31+
'': 'calc(var(--icon-size, calc(var(--font-size) + 4px)) - 2px)',
32+
// tabler icons
33+
':has(.tabler-icon)': 'var(--icon-size, var(--font-size))',
34+
},
3035
textAlign: 'center',
3136
textTransform: 'none',
3237
textRendering: 'optimizeLegibility',

src/icons/wrap-icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function wrapIcon(name: string, icon: ReactElement) {
66
function IconWrapper(props: CubeIconProps) {
77
return (
88
// use custom size to support legacy icons
9-
<Icon qa={name} aria-hidden="true" size="(@icon-size - 2px)" {...props}>
9+
<Icon qa={name} aria-hidden="true" {...props}>
1010
{icon}
1111
</Icon>
1212
);

0 commit comments

Comments
 (0)