Skip to content

Commit ba7cbe7

Browse files
crisbetojelbourn
authored andcommitted
fix(material-experimental/menu): missing outline and focus indication in high contrast mode (#16871)
Fixes the MDC-based menu panel blending in with the background in high contrast mode and the items not having focus indication.
1 parent bae65b3 commit ba7cbe7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@import '@material/list/variables';
44
@import '../../material/core/style/menu-common';
55
@import '../../material/core/style/button-common';
6+
@import '../../cdk/a11y/a11y';
67

78
@include mdc-menu-surface-core-styles($query: structure);
89

@@ -20,6 +21,10 @@
2021

2122
// The CDK positioning uses flexbox to anchor the element, whereas MDC uses `position: absolute`.
2223
position: static;
24+
25+
@include cdk-high-contrast {
26+
outline: solid 1px;
27+
}
2328
}
2429

2530
.mat-mdc-menu-item {
@@ -61,6 +66,14 @@
6166
margin-left: $mdc-list-side-padding;
6267
}
6368
}
69+
70+
@include cdk-high-contrast {
71+
&.cdk-program-focused,
72+
&.cdk-keyboard-focused,
73+
&-highlighted {
74+
outline: dotted 1px;
75+
}
76+
}
6477
}
6578

6679
// Renders out a chevron on menu items that trigger a sub-menu.

0 commit comments

Comments
 (0)