Skip to content

Commit 718f26d

Browse files
authored
Merge pull request #422 from mashmatrix/fix-icon-inverse-button
Fix button icon color in type="icon-inverse"
2 parents 63e30a0 + b76124a commit 718f26d

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/scripts/Icon.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ const SvgIcon = forwardRef(
193193
size = '',
194194
align,
195195
container,
196-
textColor,
196+
textColor = 'default',
197197
style,
198198
...rprops
199199
} = props;
@@ -204,8 +204,7 @@ const SvgIcon = forwardRef(
204204
'slds-icon': !/slds-button__icon/.test(className),
205205
[`slds-icon_${size}`]: /^(x-small|small|medium|large)$/.test(size),
206206
[`slds-icon-text-${textColor ?? 'default'}`]:
207-
/^(default|warning|error)$/.test(textColor ?? 'default') &&
208-
!iconColor,
207+
/^(default|warning|error)$/.test(textColor ?? '') && !iconColor,
209208
[`slds-icon-${iconColor ?? ''}`]: !container && iconColor,
210209
'slds-m-left_x-small': align === 'right',
211210
'slds-m-right_x-small': align === 'left',

stories/Button.stories.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,18 +286,16 @@ export const ButtonIconInverse: ComponentStoryObj<typeof Button> = {
286286
/**
287287
*
288288
*/
289-
export const ButtonIconInverseInDarkBackground: ComponentStoryObj<
290-
typeof Button
291-
> = {
292-
name: 'Button Icon Inverse in dark background',
289+
export const ButtonIconInverseDisabled: ComponentStoryObj<typeof Button> = {
290+
name: 'Button Icon Inverse - Disabled',
293291
args: {
294292
type: 'icon-inverse',
295293
icon: 'close',
296294
disabled: true,
297295
},
298296
parameters: {
299297
docs: {
300-
storyDescription: 'Button with icon in dark background',
298+
storyDescription: 'Button with icon in dark background, disabled',
301299
},
302300
},
303301
};

0 commit comments

Comments
 (0)