Skip to content

Commit fcf7ea3

Browse files
committed
fix(cdk/overlay): not setting correct opacity in high contrast mode on Firefox
The backdrop styles were never switches to the `cdk-high-contrast` mixin which means that they won't work on Firefox. These changes switch to using the mixin and update the docs. Fixes #21890.
1 parent aa7dc00 commit fcf7ea3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CODING_STANDARDS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ specific error being caught and why it cannot be prevented.
208208
* Except for `@Input` properties, use `is` and `has` prefixes for boolean properties / methods.
209209

210210
##### Observables
211-
* Don't suffix observables with `$`.
211+
* Don't suffix observables with `$`.
212212

213213
##### Classes
214214
Classes should be named based on what they're responsible for. Names should capture what the code
@@ -333,7 +333,7 @@ The latter is equivalent for the component, but makes it easier override when ne
333333
#### Support styles for Windows high-contrast mode
334334
This is a low-effort task that makes a big difference for low-vision users. Example:
335335
```css
336-
@media screen and (-ms-high-contrast: active) {
336+
@include cdk-high-contrast(active, off) {
337337
.unicorn-motocycle {
338338
border: 1px solid #fff !important;
339339
}

src/cdk/overlay/_overlay.scss

Lines changed: 3 additions & 1 deletion
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.
@@ -84,7 +86,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
8486
// to making it opaque using `opacity`. Note that we can't use the `cdk-high-contrast`
8587
// mixin, because we can't normalize the import path to the _a11y.scss both for the
8688
// source and when this file is distributed. See #10908.
87-
@media screen and (-ms-high-contrast: active) {
89+
@include cdk-high-contrast(active, off) {
8890
opacity: 0.6;
8991
}
9092
}

0 commit comments

Comments
 (0)