Skip to content

Commit 8cfa8e8

Browse files
authored
fix(material-experimental/mdc-radio): no focus indication in h… (#18969)
Along the same lines as #13280, but for the MDC component. Adds an outline around the circle when focused in high contrast mode.
1 parent 8c3ba38 commit 8cfa8e8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import '@material/radio/variables.import';
33
@import '@material/form-field/mixins.import';
44
@import '../mdc-helpers/mdc-helpers';
5+
@import '../../cdk/a11y/a11y';
56

67
@include mdc-radio-without-ripple($query: $mat-base-styles-query);
78
@include mdc-form-field-core-styles($query: $mat-base-styles-query);
@@ -21,3 +22,12 @@
2122
opacity: $mdc-radio-ripple-opacity;
2223
}
2324
}
25+
26+
// Note that this creates a square box around the circle, however it's consistent with
27+
// how IE/Edge treat native radio buttons in high contrast mode. We can't turn the border
28+
// into a dotted one, because it's too thick which causes the circles to look off.
29+
@include cdk-high-contrast {
30+
.mat-mdc-radio-button.cdk-keyboard-focused .mat-radio-ripple {
31+
outline: dotted 1px;
32+
}
33+
}

0 commit comments

Comments
 (0)