Skip to content

fix(material-experimental/mdc-radio): no focus indication in high contrast mode #18969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/material-experimental/mdc-radio/radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@import '@material/radio/variables.import';
@import '@material/form-field/mixins.import';
@import '../mdc-helpers/mdc-helpers';
@import '../../cdk/a11y/a11y';

@include mdc-radio-without-ripple($query: $mat-base-styles-query);
@include mdc-form-field-core-styles($query: $mat-base-styles-query);
Expand All @@ -21,3 +22,12 @@
opacity: $mdc-radio-ripple-opacity;
}
}

// Note that this creates a square box around the circle, however it's consistent with
// how IE/Edge treat native radio buttons in high contrast mode. We can't turn the border
// into a dotted one, because it's too thick which causes the circles to look off.
@include cdk-high-contrast {
.mat-mdc-radio-button.cdk-keyboard-focused .mat-radio-ripple {
outline: dotted 1px;
}
}