Skip to content

Commit 2e1214f

Browse files
authored
fix(material/radio): add high contrast focus indication (#22145)
* Adds focus indication in high contrast mode to the non-MDC radio button. * Makes the focus indication on the MDC radio button more prominent.
1 parent 1fac491 commit 2e1214f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/material-experimental/mdc-radio/radio.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525
// how IE/Edge treat native radio buttons in high contrast mode. We can't turn the border
2626
// into a dotted one, because it's too thick which causes the circles to look off.
2727
@include a11y.high-contrast {
28-
.mat-mdc-radio-button.cdk-keyboard-focused .mat-radio-ripple {
29-
outline: dotted 1px;
28+
.mat-mdc-radio-button:not(.mat-radio-disabled) {
29+
&.cdk-keyboard-focused,
30+
&.cdk-program-focused {
31+
.mat-radio-ripple {
32+
outline: solid 3px;
33+
}
34+
}
3035
}
3136
}

src/material/radio/radio.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ $ripple-radius: 20px;
186186
}
187187

188188
@include a11y.high-contrast(active, off) {
189+
.mat-radio-button:not(.mat-radio-disabled) {
190+
&.cdk-keyboard-focused,
191+
&.cdk-program-focused {
192+
.mat-radio-ripple {
193+
outline: solid 3px;
194+
}
195+
}
196+
}
197+
189198
.mat-radio-disabled {
190199
opacity: 0.5;
191200
}

0 commit comments

Comments
 (0)