Skip to content

Commit 8366ec6

Browse files
crisbetojelbourn
authored andcommitted
fix(overlay): opaque backdrop appearing solid in high contrast mode (#10252)
Recently we switched to using an RGBA color to make the backdrop opaque, instead of setting the opacity. This is more convenient when it comes to overriding and animating it, however it causes high contrast mode on Windows to display it as a solid color. These changes add a fallback that will use the `opacity`.
1 parent 356ba71 commit 8366ec6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cdk/overlay/_overlay.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import '../a11y/a11y';
2+
13
// We want overlays to always appear over user content, so set a baseline
24
// very high z-index for the overlay container, which is where we create the new
35
// stacking context for all overlays.
@@ -71,6 +73,12 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
7173

7274
&.cdk-overlay-backdrop-showing {
7375
opacity: 1;
76+
77+
// In high contrast mode the rgba background will become solid
78+
// so we need to fall back to making it opaque using `opacity`.
79+
@include cdk-high-contrast {
80+
opacity: 0.6;
81+
}
7482
}
7583
}
7684

0 commit comments

Comments
 (0)