Skip to content

Commit caf65e5

Browse files
devversionvivian-hu-zz
authored andcommitted
fix(checkbox): no focus indicator in high contrast (#13255)
* Fixes that the checkbox does not have a focus indicator in high-contrast. Similarly to native checkboxes, the Material checkbox should have a dotted border/outline on keyboard focus. Fixes #13227
1 parent a150494 commit caf65e5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib/checkbox/checkbox.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,14 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * $mat-checkbox-size !default;
240240
._mat-animation-noopable & {
241241
transition: none;
242242
}
243+
244+
@include cdk-high-contrast {
245+
// Note that we change the border style of the checkbox frame to dotted because this
246+
// is how IE/Edge similarly treats native checkboxes in high contrast mode.
247+
.mat-checkbox.cdk-keyboard-focused & {
248+
border-style: dotted;
249+
}
250+
}
243251
}
244252

245253
.mat-checkbox-background {

0 commit comments

Comments
 (0)