Skip to content

[overlay] 0.48 opacity of showing backdrop is unexpected #7855

@willshowell

Description

@willshowell

Bug, feature request, or proposal:

Proposal

Expected behavior

Providing a custom backdrop class with background-color: red would result in a fully opaque backdrop.

Current behavior

Be default, that backdrop will be at 0.48 opacity. To make it fully opaque,

  1. You must explicitly set opacity: 1
  2. You must do so appropriately within .cdk-overlay-backdrop-showing which requires at least a little digging through the DOM or source

https://stackblitz.com/edit/angular-material2-issue-t9xu95?file=styles.scss

Relevant code

https://github.com/angular/material2/blob/26bbeb2cda3ab9d03c00dbb45e2317a48feed5d8/src/cdk/overlay/_overlay.scss#L8-L9

https://github.com/angular/material2/blob/26bbeb2cda3ab9d03c00dbb45e2317a48feed5d8/src/cdk/overlay/_overlay.scss#L64-L68

Motivation

Showing a backdrop which is darker than 0.48 opacity it slightly more troublesome than it could be.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Latest

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions