Skip to content

Commit 0777c44

Browse files
authored
fix(material-experimental/mdc-tabs): missing focus indication in high contrast mode (#17601)
Fixes the MDC-based tabs not having focus indication in high contrast mode.
1 parent e6d9c1b commit 0777c44

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/material-experimental/mdc-tabs/_tabs-common.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ $mat-tab-animation-duration: 500ms !default;
4646
.mdc-tab__ripple::before {
4747
opacity: map-get($mdc-ripple-dark-ink-opacities, focus);
4848
}
49+
50+
// The usual focus indication is color-based so it won't show up in
51+
// high contrast mode. Add an outline which is a bit more visible.
52+
@include cdk-high-contrast {
53+
$outline-width: 2px;
54+
outline: dotted $outline-width;
55+
outline-offset: -$outline-width; // Not supported on IE, but looks better everywhere else.
56+
}
4957
}
5058

5159
.mat-ripple-element {

0 commit comments

Comments
 (0)