Skip to content

Commit 4ed68d4

Browse files
committed
fix(radio): missing radio indication in high contrast mode
Currently we use ripples for focus indication on radio buttons, however they're hidden in high contrast mode. These changes add an outline as a fallback.
1 parent 1852563 commit 4ed68d4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib/radio/radio.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ $mat-radio-ripple-radius: 20px;
5252
._mat-animation-noopable & {
5353
transition: none;
5454
}
55+
56+
// Note that this creates a square box around the circle, however it's consistent with
57+
// how IE/Edge treat native radio buttons in high contrast mode. We can't turn the border
58+
// into a dotted one, because it's too thick which causes the circles to look off.
59+
@include cdk-high-contrast {
60+
.mat-radio-button.cdk-focused & {
61+
outline: dotted 1px;
62+
}
63+
}
64+
5565
}
5666

5767
// The inner circle for the radio, shown when checked.

0 commit comments

Comments
 (0)