Skip to content

Commit 89835d3

Browse files
authored
refactor(radio): style component using sass theme (#16476)
1 parent e4a8e3c commit 89835d3

File tree

4 files changed

+48
-26
lines changed

4 files changed

+48
-26
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ $_theme: $material;
6868
cursor: pointer;
6969

7070
&:hover {
71+
@include e(label) {
72+
color: var-get($_theme, 'label-color-hover');
73+
}
74+
7175
@include e(composite) {
7276
&::before {
7377
background: var-get($_theme, 'hover-color');
@@ -306,6 +310,10 @@ $_theme: $material;
306310
}
307311

308312
&:hover {
313+
@include e(label) {
314+
color: var-get($_theme, 'error-color');
315+
}
316+
309317
@include e(ripple) {
310318
@extend %radio-ripple--hover;
311319
@extend %radio-ripple--hover-invalid;
@@ -317,7 +325,7 @@ $_theme: $material;
317325
}
318326

319327
&::after {
320-
border-color: var-get($_theme, 'error-color-hover');
328+
border-color: var-get($_theme, 'error-color');
321329
}
322330
}
323331
}

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

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ $_theme: $bootstrap;
7272
box-shadow: 0 0 0 rem(4px) var-get($_theme, 'focus-outline-color');
7373

7474
&::after {
75-
border-color: color($color: 'primary', $variant: 200);
75+
border-color: var-get($_theme, 'focus-border-color');
7676
}
7777
}
7878

7979
&:hover {
8080
@include e(composite) {
8181
&::after {
82-
border-color: color($color: 'primary', $variant: 300);
82+
border-color: hsl(from var-get($_theme, 'focus-border-color') h calc(s * 1.12) calc(l * 0.82));
8383
}
8484
}
8585
}
@@ -112,14 +112,6 @@ $_theme: $bootstrap;
112112
}
113113

114114
@include m(invalid) {
115-
@include e(composite) {
116-
&::after {
117-
background: transparent;
118-
border: var(--border-width) solid
119-
var-get($_theme, 'error-color');
120-
}
121-
}
122-
123115
&:hover {
124116
@include e(composite) {
125117
&::after {
@@ -154,11 +146,10 @@ $_theme: $bootstrap;
154146
@include e(composite) {
155147
&::after {
156148
background: var-get($_theme, 'error-color');
157-
border-color: var-get($_theme, 'error-color');
158149
}
159150

160151
&::before {
161-
background: white;
152+
background: var-get($_theme, 'fill-hover-border-color');
162153
}
163154
}
164155

@@ -181,15 +172,6 @@ $_theme: $bootstrap;
181172
}
182173
}
183174

184-
@include mx(checked, invalid, focused) {
185-
@include e(composite) {
186-
&::before {
187-
background: white;
188-
border-color: transparent;
189-
}
190-
}
191-
}
192-
193175
@include mx(invalid, disabled) {
194176
@include e(composite) {
195177
&::after {

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,31 @@ $_theme: $fluent;
3636
box-shadow: 0 0 0 rem(1px) var-get($_theme, 'focus-outline-color');
3737
}
3838
}
39+
40+
@include m(invalid) {
41+
&:hover {
42+
@include e(composite) {
43+
&::after {
44+
border-color: var-get($_theme, 'error-color-hover');
45+
}
46+
}
47+
}
48+
}
49+
50+
@include mx(checked, invalid, focused) {
51+
&:hover {
52+
@include e(composite) {
53+
&::before {
54+
background: var-get($_theme, 'error-color-hover');
55+
border-color: var-get($_theme, 'error-color-hover');
56+
}
57+
58+
&::after {
59+
border-color: var-get($_theme, 'error-color-hover');
60+
}
61+
}
62+
}
63+
}
3964
}
4065

4166
@include themed-block(igx-radio-group, fluent) {

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ $_theme: $indigo;
1919
}
2020

2121
&:hover {
22-
@include e(label) {
23-
color: var-get($_theme, 'label-color-hover');
24-
}
25-
2622
@include e(composite) {
2723
&::after {
2824
border-color: var-get($_theme, 'hover-color');
@@ -92,6 +88,17 @@ $_theme: $indigo;
9288
}
9389
}
9490

91+
@include mx(checked, invalid, focused) {
92+
&:hover {
93+
@include e(composite) {
94+
&::before {
95+
background: var-get($_theme, 'error-color-hover');
96+
border-color: var-get($_theme, 'error-color-hover');
97+
}
98+
}
99+
}
100+
}
101+
95102
@include m(disabled) {
96103
@include e(label) {
97104
color: var-get($_theme, 'disabled-label-color');

0 commit comments

Comments
 (0)