Skip to content

Commit 61e9ded

Browse files
make textColor and currentColor mutually exclusive
1 parent da113a2 commit 61e9ded

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/scripts/Icon.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export type IconSize = 'xx-small' | 'x-small' | 'small' | 'medium' | 'large';
151151
export type IconContainer = 'circle';
152152
export type IconTextColor =
153153
| 'default'
154+
| 'currentColor'
154155
| 'success'
155156
| 'warning'
156157
| 'error'
@@ -173,7 +174,6 @@ export type IconProps = {
173174
tabIndex?: number;
174175
fillColor?: string;
175176
title?: string;
176-
currentColor?: boolean;
177177
flip?: boolean;
178178
} & SVGAttributes<SVGElement>;
179179

@@ -246,8 +246,8 @@ export const Icon = createFC<IconProps, { ICONS: typeof ICONS }>(
246246
label,
247247
containerClassName: containerClassName_,
248248
fillColor,
249+
textColor = 'default',
249250
title,
250-
currentColor,
251251
flip,
252252
...rprops
253253
} = props;
@@ -286,7 +286,7 @@ export const Icon = createFC<IconProps, { ICONS: typeof ICONS }>(
286286
: null,
287287
fillIconColor ? `slds-icon-${fillIconColor}` : null,
288288
{
289-
'slds-current-color': currentColor,
289+
'slds-current-color': textColor === 'currentColor',
290290
'slds-icon_flip': flip,
291291
}
292292
);

0 commit comments

Comments
 (0)