Skip to content

Commit

Permalink
fix: SystemIcon supports rem by default (#3031)
Browse files Browse the repository at this point in the history
Add a `rem` value for the default size to `SystemIcon`

Fixes #3028

[category:Components]
  • Loading branch information
NicholasBoll authored Nov 5, 2024
1 parent 2a7e546 commit 95d434e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/react/icon/lib/SystemIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {CanvasSystemIcon, CanvasIconTypes} from '@workday/design-assets-types';
import {CSSObject} from '@emotion/styled';
import {createComponent, getColor} from '@workday/canvas-kit-react/common';
import {cssVar, createStencil, handleCsProp, px2rem, createVars} from '@workday/canvas-kit-styling';
import {base} from '@workday/canvas-tokens-web';
import {base, system} from '@workday/canvas-tokens-web';
import {Svg, SvgProps, svgStencil, transformColorNameToToken} from './Svg';

/**
Expand Down Expand Up @@ -153,7 +153,11 @@ export const systemIconStencil = createStencil({
accentColor: '',
backgroundColor: '',
},
base: ({accentColor, backgroundColor, color}) => ({
base: ({size, width, height, accentColor, backgroundColor, color}) => ({
'& svg': {
width: cssVar(width, cssVar(size, system.space.x6)),
height: cssVar(height, cssVar(size, system.space.x6)),
},
[backgroundColor]: cssVar(backgroundColor, 'transparent'),
'& .wd-icon-fill': {
fill: cssVar(color, base.licorice200),
Expand Down

0 comments on commit 95d434e

Please sign in to comment.