Skip to content

Commit 64b9203

Browse files
didimmovasimeonoffkdinev
authored
fix(button/btn-group): bind icon colors to foreground colors in theme (#14217)
* fix(button/btn-group): bind icon colors to foreground colors in theme * fix(button): add if-statement for icon-color-hover * fix(button): use active-foreground for icon color in active state --------- Co-authored-by: Simeon Simeonoff <[email protected]> Co-authored-by: Konstantin Dinev <[email protected]>
1 parent 740c12e commit 64b9203

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@
7373
$shadow: null,
7474
7575
$item-text-color: null,
76-
$item-icon-color: null,
76+
$item-icon-color: $item-text-color,
7777
$item-background: null,
7878
$item-border-color: null,
7979
8080
$item-hover-text-color: null,
81-
$item-hover-icon-color: null,
81+
$item-hover-icon-color: $item-hover-text-color,
8282
$item-hover-background: null,
8383
$item-hover-border-color: null,
8484
@@ -95,19 +95,19 @@
9595
$item-disabled-border: null,
9696
9797
$item-selected-text-color: null,
98-
$item-selected-icon-color: null,
98+
$item-selected-icon-color: $item-selected-text-color,
9999
$item-selected-background: null,
100100
$item-selected-border-color: null,
101101
102102
$item-selected-hover-text-color: null,
103-
$item-selected-hover-icon-color: null,
103+
$item-selected-hover-icon-color: $item-selected-hover-text-color,
104104
$item-selected-hover-background: null,
105105
$item-selected-hover-border-color: null,
106106
$item-selected-focus-background: null,
107107
$item-selected-focus-hover-background: null,
108108
109109
$disabled-selected-text-color: null,
110-
$disabled-selected-icon-color: null,
110+
$disabled-selected-icon-color: $disabled-selected-text-color,
111111
$disabled-selected-background: null,
112112
$disabled-selected-border-color: null,
113113
) {
@@ -140,7 +140,7 @@
140140

141141
@if not($item-selected-background) and $item-background {
142142
@if meta.type-of($item-background) == 'color' {
143-
$item-selected-text-color: text-contrast($item-background);
143+
$item-selected-background: text-contrast($item-background);
144144
}
145145
}
146146

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
$hover-background: null,
6666
$hover-foreground: null,
6767
68-
$icon-color: null,
69-
$icon-color-hover: null,
68+
$icon-color: $foreground,
69+
$icon-color-hover: $hover-foreground,
7070
7171
$focus-background: null,
7272
$focus-foreground: null,
@@ -96,7 +96,7 @@
9696
9797
$disabled-background: null,
9898
$disabled-foreground: null,
99-
$disabled-icon-color: null,
99+
$disabled-icon-color: $disabled-foreground,
100100
$disabled-border-color: null,
101101
$size: null,
102102
) {
@@ -139,6 +139,12 @@
139139
}
140140
}
141141

142+
@if not($icon-color-hover) and $hover-foreground {
143+
@if meta.type-of($hover-background) == 'color' {
144+
$icon-color-hover: $hover-foreground;
145+
}
146+
}
147+
142148
@if not($focus-background) and $background {
143149
$focus-background: color.scale($background, $lightness: 5%);
144150
}
@@ -761,6 +767,10 @@
761767
background: var-get($contained-theme, 'active-background');
762768
border-color: var-get($contained-theme, 'active-border-color');
763769
box-shadow: var-get($contained-theme, 'hover-shadow');
770+
771+
igx-icon {
772+
color: var-get($contained-theme, 'active-foreground');
773+
}
764774
}
765775

766776
@if ($variant == 'indigo-design') {
@@ -898,6 +908,10 @@
898908
border-color: var-get($fab-theme, 'active-border-color');
899909
box-shadow: var-get($fab-theme, 'focus-shadow');
900910

911+
igx-icon {
912+
color: var-get($fab-theme, 'active-foreground');
913+
}
914+
901915
@if ($variant == 'indigo-design') {
902916
igx-icon {
903917
color: var-get($outlined-theme, 'icon-color-hover');

0 commit comments

Comments
 (0)