Skip to content

Commit

Permalink
fix: Ensure button label icon uses rem (#3001)
Browse files Browse the repository at this point in the history
Fixes: #3000

[category:Components]

Co-authored-by: manuel.carrera <[email protected]>
  • Loading branch information
mannycarrera4 and manuel.carrera authored Oct 23, 2024
1 parent d44c9cc commit 486e5fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions modules/react/button/lib/parts/ButtonLabelIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import {ButtonSizes} from '../types';
import {createComponent} from '@workday/canvas-kit-react/common';
import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
import {px2rem} from '@workday/canvas-kit-styling';

export interface ButtonLabelIconProps extends Partial<SystemIconProps> {
/**
Expand Down Expand Up @@ -42,8 +43,8 @@ export const ButtonLabelIcon = createComponent('span')({
size={iconSize}
icon={icon}
shouldMirror={shouldMirrorIcon}
width={size ? iconSizes[size] : iconSizes.large}
height={size ? iconSizes[size] : iconSizes.large}
width={px2rem(iconSize)}
height={px2rem(iconSize)}
display="inline-block"
{...elemProps}
/>
Expand Down
2 changes: 1 addition & 1 deletion modules/react/button/stories/button/examples/Primary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export const Primary = () => (
<PrimaryButton icon={caretDownIcon} iconPosition="end">
Primary
</PrimaryButton>
<PrimaryButton size="small" icon={relatedActionsVerticalIcon} />
<PrimaryButton icon={relatedActionsVerticalIcon} />
</Flex>
);

0 comments on commit 486e5fb

Please sign in to comment.