Skip to content

Commit fe28167

Browse files
authored
fix(radio): fluent theme inconsistencies (#12720)
1 parent bbd5b80 commit fe28167

File tree

4 files changed

+64
-13
lines changed

4 files changed

+64
-13
lines changed

projects/igniteui-angular/src/lib/core/styles/components/radio/_radio-component.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,18 @@
158158
@include mx(focused, checked) {
159159
@extend %igx-radio--focused-checked !optional;
160160

161+
&:hover {
162+
@include e(composite) {
163+
@extend %igx-radio--checked-active__composite !optional;
164+
}
165+
}
166+
167+
&:active {
168+
@include e(composite) {
169+
@extend %igx-radio--checked-active__composite !optional;
170+
}
171+
}
172+
161173
@include e(ripple) {
162174
@extend %radio-ripple--focused !optional;
163175
@extend %radio-ripple--focused-checked !optional;

projects/igniteui-angular/src/lib/core/styles/components/radio/_radio-theme.scss

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,20 @@
409409

410410
%igx-radio--focused {
411411
@if $variant == 'fluent' {
412+
position: relative;
413+
$focus-outline-offset-top: rem(2px);
414+
$focus-outline-offset-left: rem(2px);
415+
416+
&::after {
417+
content: '';
418+
position: absolute;
419+
top: -$focus-outline-offset-top;
420+
inset-inline-start: -$focus-outline-offset-left;
421+
box-shadow: 0 0 0 rem(1px) var-get($theme, 'focus-outline-color');
422+
width: calc(100% + (#{$focus-outline-offset-left} * 2));
423+
height: calc(100% + (#{$focus-outline-offset-top} * 2));
424+
}
425+
412426
%radio-composite {
413427
&::before {
414428
background: var-get($theme, 'hover-color');
@@ -436,11 +450,11 @@
436450
@if $variant == 'fluent' {
437451
%radio-composite--x {
438452
&::before {
439-
background: var-get($theme, 'fill-color-hover');
453+
background: var-get($theme, 'fill-color');
440454
}
441455

442456
&::after {
443-
border: $border-width $border-style var-get($theme, 'fill-color-hover');
457+
border: $border-width $border-style var-get($theme, 'fill-color');
444458
}
445459
}
446460
}

projects/igniteui-angular/src/lib/core/styles/themes/schemas/dark/_radio.scss

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,42 @@ $dark-radio: extend($light-radio, (
1616

1717
/// Generates a dark fluent radio schema.
1818
/// @type {Map}
19-
/// @prop {Map} fill-hover-border-color [color: ('primary', 200)] - The text color used for the label text.
20-
/// @prop {Map} fill-color-hover [color: ('primary', 200)] - The checked border and dot colors on hover.
19+
/// @prop {Map} hover-color [color: ('gray', 400)] - The border and dot colors on hover.
20+
/// @prop {Map} fill-color [color: ('primary', 300)] - The checked border and dot colors.
21+
/// @prop {Map} fill-hover-border-color [color: ('primary', 100)] - The text color used for the label text.
22+
/// @prop {Map} fill-color-hover [color: ('primary', 100)] - The checked border and dot colors on hover.
2123
/// @prop {Map} error-color-hover [color: ('error', 200)] - The border and dot color in invalid state on hover.
24+
/// @prop {Map} disabled-color [color: ('gray', 100)] - The disabled border and dot colors.
25+
/// @prop {Map} disabled-label-color [color: ('gray', 300)] - The disabled label color.
2226
/// @requires $fluent-radio
2327
$dark-fluent-radio: extend($fluent-radio, (
28+
hover-color: (
29+
color: ('gray', 400)
30+
),
31+
32+
fill-color: (
33+
color: ('primary', 300)
34+
),
35+
2436
fill-hover-border-color: (
25-
color: ('primary', 200)
37+
color: ('primary', 100)
2638
),
2739

2840
fill-color-hover: (
29-
color: ('primary', 200)
41+
color: ('primary', 100)
3042
),
3143

3244
error-color-hover: (
3345
color: ('error', 200)
34-
)
46+
),
47+
48+
disabled-color: (
49+
color: ('gray', 100)
50+
),
51+
52+
disabled-label-color: (
53+
color: ('gray', 300)
54+
),
3555
));
3656

3757
/// Generates a dark bootstrap radio schema.

projects/igniteui-angular/src/lib/core/styles/themes/schemas/light/_radio.scss

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/// @prop {Map} fill-color [color: ('secondary', 500)] - The checked border and dot colors.
1616
/// @prop {Map} fill-color-hover [color: ('secondary', 500)] - The checked border and dot colors on hover.
1717
/// @prop {Map} disabled-color [color: ('gray', 400)] - The disabled border and dot colors.
18-
/// @prop {Map} disabled-label-color [color: ('gray', 400)] - The disabled border and dot colors.
18+
/// @prop {Map} disabled-label-color [color: ('gray', 400)] - The disabled label color.
1919
/// @prop {Map} error-color [color: ('error', 500)] - The label, border and dot color in invalid state.
2020
/// @prop {Map} error-color-hover [color: ('error', 500)] - The border and dot color in invalid state on hover.
2121
$light-radio: (
@@ -65,12 +65,13 @@ $light-radio: (
6565
/// Generates a fluent radio schema.
6666
/// @type {Map}
6767
/// @prop {Map} hover-color [color: ('gray', 700)] - The border and dot colors on hover.
68-
/// @prop {Map} fill-hover-border-color [color: ('primary', 900)] - The checked dot border color on hover.
68+
/// @prop {Map} fill-hover-border-color [color: ('primary', 800)] - The checked dot border color on hover.
6969
/// @prop {Map} empty-color [color: ('gray', 900)] - The unchecked border color.
7070
/// @prop {Map} fill-color [color: ('primary', 500)] - The checked border and dot colors.
71-
/// @prop {Map} fill-color-hover [color: ('primary',900)] - The checked border and dot colors on hover.
71+
/// @prop {Map} fill-color-hover [color: ('primary', 800)] - The checked border and dot colors on hover.
7272
/// @prop {Map} focus-outline-color [color: ('gray', 700)] - The focus outlined color.
7373
/// @prop {Map} error-color-hover [color: ('error', 700)] - The border and dot color in invalid state on hover.
74+
/// @prop {Map} disabled-label-color [color: ('gray', 500)] - The disabled label color.
7475
/// @requires {Map} $light-radio
7576
$fluent-radio: extend(
7677
$light-radio,
@@ -86,7 +87,7 @@ $fluent-radio: extend(
8687
),
8788

8889
fill-hover-border-color: (
89-
color: ('primary', 900)
90+
color: ('primary', 800)
9091
),
9192

9293
empty-color: (
@@ -98,12 +99,16 @@ $fluent-radio: extend(
9899
),
99100

100101
fill-color-hover: (
101-
color: ('primary', 900)
102+
color: ('primary', 800)
102103
),
103104

104105
error-color-hover: (
105106
color: ('error', 700)
106-
)
107+
),
108+
109+
disabled-label-color: (
110+
color: ('gray', 500)
111+
),
107112
)
108113
);
109114

0 commit comments

Comments
 (0)