Skip to content

Commit e77d5aa

Browse files
authored
fix(button): idle icon color not updated (#14319)
The icon color should change the way the text changes if the $background theme property is updated.
1 parent 8e799e3 commit e77d5aa

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

projects/igniteui-angular/src/lib/core/styles/components/button/_button-theme.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@
139139
}
140140
}
141141

142+
@if not($icon-color) and $background {
143+
@if meta.type-of($background) == 'color' {
144+
$icon-color: text-contrast($background);
145+
}
146+
}
147+
142148
@if not($icon-color-hover) and $hover-foreground {
143149
@if meta.type-of($hover-background) == 'color' {
144150
$icon-color-hover: $hover-foreground;
@@ -577,7 +583,7 @@
577583
background: var-get($flat-theme, 'focus-visible-background');
578584
color: var-get($flat-theme, 'focus-visible-foreground');
579585
border-color: var-get($flat-theme, 'focus-visible-border-color');
580-
586+
581587
igx-icon {
582588
color: var-get($flat-theme, 'icon-color');
583589
}
@@ -599,7 +605,7 @@
599605
color: var-get($flat-theme, 'focus-foreground');
600606
}
601607
}
602-
608+
603609
@if ($variant == 'bootstrap') {
604610
box-shadow: 0 0 0 rem(4px) var-get($flat-theme, 'shadow-color');
605611
}
@@ -780,7 +786,7 @@
780786
map.get($items-gap, 'cosy'),
781787
$items-gap-indigo-comfortable
782788
);
783-
789+
784790
&:active {
785791
igx-icon {
786792
color: var-get($outlined-theme, 'icon-color-hover');

0 commit comments

Comments
 (0)