Skip to content

Commit 4ef47d6

Browse files
authored
fix(checkbox): fix checkbox styles to be identic between projects (#16372)
* fix(checkbox): fix checkbox styles to be identic between projects * fix(checkbox): fix latest addressed problems
1 parent 6505af5 commit 4ef47d6

File tree

5 files changed

+65
-23
lines changed

5 files changed

+65
-23
lines changed

projects/igniteui-angular/src/lib/checkbox/themes/_base.scss

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,22 @@ $_theme: $material;
6262
background: var-get($_theme, 'error-color');
6363
}
6464

65-
%cbx-ripple--hover-checked,
6665
%cbx-ripple--focused-checked {
6766
@extend %cbx-ripple--filled;
6867
}
6968

70-
%cbx-ripple--hover-invalid,
69+
%cbx-ripple--hover-checked {
70+
background: var-get($_theme, 'fill-color-hover');
71+
}
72+
7173
%cbx-ripple--focused-invalid {
7274
@extend %cbx-ripple--error;
7375
}
7476

77+
%cbx-ripple--hover-invalid {
78+
background: var-get($_theme, 'error-color-hover');
79+
}
80+
7581
@include b(igx-checkbox) {
7682
// TODO: These should be moved to the shema as design tokens
7783
--size: #{rem(20px)};
@@ -93,6 +99,14 @@ $_theme: $material;
9399
@include e(ripple) {
94100
@extend %cbx-ripple--hovered;
95101
}
102+
103+
@include e(label) {
104+
color: var-get($_theme, 'label-color-hover');
105+
}
106+
107+
@include e(label, $m: before) {
108+
color: var-get($_theme, 'label-color-hover');
109+
}
96110
}
97111

98112
&:active {
@@ -200,6 +214,14 @@ $_theme: $material;
200214
@include e(composite) {
201215
border-color: var-get($_theme, 'error-color-hover');
202216
}
217+
218+
@include e(label) {
219+
color: var-get($_theme, 'error-color');
220+
}
221+
222+
@include e(label, $m: before) {
223+
color: var-get($_theme, 'error-color');
224+
}
203225
}
204226

205227
&:active {

projects/igniteui-angular/src/lib/checkbox/themes/shared/_bootstrap.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ $_theme: $bootstrap;
7979
box-shadow: 0 0 0 rem(4px)
8080
var-get($_theme, 'focus-outline-color-error');
8181
}
82+
83+
&:hover {
84+
@include e(composite) {
85+
border-color: var-get($_theme, 'error-color-hover');
86+
}
87+
}
8288
}
8389

8490
@include mx(focused, indeterminate) {
@@ -92,12 +98,9 @@ $_theme: $bootstrap;
9298
background: var-get($_theme, 'disabled-indeterminate-color');
9399
border-color: transparent;
94100
}
95-
}
96101

97-
@include mx(indeterminate, invalid) {
98-
@include e(composite) {
99-
background: var-get($_theme, 'error-color');
100-
border-color: transparent;
102+
@include e(composite-mark) {
103+
stroke: var-get($_theme, 'disabled-tick-color');
101104
}
102105
}
103106

projects/igniteui-angular/src/lib/checkbox/themes/shared/_fluent.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ $_theme: $fluent;
8888
}
8989
}
9090

91+
@include m(invalid) {
92+
&:hover {
93+
@include e(composite-mark) {
94+
stroke: var-get($_theme, 'error-color');
95+
}
96+
}
97+
}
98+
9199
@include m(checked) {
92100
&:hover {
93101
@include e(composite) {
@@ -161,6 +169,10 @@ $_theme: $fluent;
161169
background: var-get($_theme, 'disabled-color');
162170
border-color: var-get($_theme, 'disabled-color');
163171
}
172+
173+
@include e(composite-mark) {
174+
stroke: var-get($_theme, 'disabled-tick-color');
175+
}
164176
}
165177

166178
@include mx(disabled, indeterminate) {

projects/igniteui-angular/src/lib/checkbox/themes/shared/_indigo.scss

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ $_theme: $indigo;
3535
@include type-style(body-2);
3636
transition: color 0.2s $ease-out-quad;
3737
transition-delay: var(--_transition-delay);
38-
39-
&:hover {
40-
color: var-get($_theme, 'label-color-hover');
41-
}
4238
}
4339

4440
@include e(label) {
@@ -63,19 +59,27 @@ $_theme: $indigo;
6359
}
6460

6561
@include m(invalid) {
66-
&:hover {
67-
@include e(composite) {
68-
border-color: var-get($_theme, 'error-color-hover');
69-
}
70-
}
71-
7262
@include e(label) {
7363
color: var-get($_theme, 'label-color');
7464
}
7565

7666
@include e(label, $m: before) {
7767
color: var-get($_theme, 'label-color');
7868
}
69+
70+
&:hover {
71+
@include e(composite) {
72+
border-color: var-get($_theme, 'error-color-hover');
73+
}
74+
75+
@include e(label) {
76+
color: var-get($_theme, 'label-color-hover');
77+
}
78+
79+
@include e(label, $m: before) {
80+
color: var-get($_theme, 'label-color-hover');
81+
}
82+
}
7983
}
8084

8185
@include m(indeterminate) {
@@ -135,6 +139,13 @@ $_theme: $indigo;
135139
}
136140
}
137141

142+
@include mx(focused, invalid, indeterminate) {
143+
@include e(composite) {
144+
box-shadow: 0 0 0 rem(3px)
145+
var-get($_theme, 'focus-outline-color-error');
146+
}
147+
}
148+
138149
@include mx(focused, indeterminate) {
139150
@include e(composite) {
140151
border-radius: var-get($_theme, 'border-radius');

projects/igniteui-angular/src/lib/checkbox/themes/shared/_material.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ $_theme: $material;
2222
padding: var(--composite-padding);
2323
}
2424

25-
@include mx(invalid, checked) {
26-
@include e(composite) {
27-
background: var-get($_theme, 'error-color');
28-
}
29-
}
30-
3125
@include mx(invalid, disabled) {
3226
@include e(composite) {
3327
border-color: var-get($_theme, 'disabled-color');

0 commit comments

Comments
 (0)