Skip to content

Commit 4ff1fd4

Browse files
crisbetojelbourn
authored andcommitted
feat(overlay): make it easier to override backdrop color (#9114)
Previously the dark backdrop color was `rgba(0, 0, 0, 0.6)` to which we also added an opacity of `0.48`. This is hard to reason about, because we've got two stacking opacities that the consumer would have to multiply in order to figure out what the actual color is, in addition to being hard to override. These changes switch to animating the backdrop between 0 and 1, as well as setting the backdrop color to `rgba(0, 0, 0, 0.288)` (0.288 being 0.48 * 0.6). Fixes #7855.
1 parent 43406b3 commit 4ff1fd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cdk/overlay/_overlay.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $cdk-z-index-overlay: 1000;
66
$cdk-z-index-overlay-backdrop: 1000;
77

88
// Background color for all of the backdrops
9-
$cdk-overlay-dark-backdrop-background: rgba(0, 0, 0, 0.6);
9+
$cdk-overlay-dark-backdrop-background: rgba(0, 0, 0, 0.288);
1010

1111
// Default backdrop animation is based on the Material Design swift-ease-out.
1212
$backdrop-animation-duration: 400ms !default;
@@ -64,7 +64,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
6464
opacity: 0;
6565

6666
&.cdk-overlay-backdrop-showing {
67-
opacity: 0.48;
67+
opacity: 1;
6868
}
6969
}
7070

0 commit comments

Comments
 (0)