Closed
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
14.x.x
Description
Before v15, we could specify an opacity for a custom elevation like so :
@use "@angular/material" as mat;
.foo {
@include mat.elevation(2, black, 0.36);
}
But since v15, opacity argument has been removed. Then I try to set opacity directly to the color like so :
@use "@angular/material" as mat;
.foo {
@include mat.elevation(2, rgba(black, 0.36));
}
The resulting shadow is black as intendended but with a full opacity instead of 36%
Reproduction
Steps to reproduce:
- Add a dumb container like
<div class="with-elevation">Hello world!</div>
- Add the following code to your
styles.scss
file
.with-elevation {
@include mat.elevation(2, black);
}
- Observe
- Replace previous style code with the following
.with-elevation {
@include mat.elevation(2, rgba(black, 0.36));
}
- Observe, you can see nothing changed
Expected Behavior
Opacity should be took in consideration
Actual Behavior
Opacity skipped and replaced
Environment
- Angular: 15.0.0
- CDK/Material: 15.0.0
- Browser(s): any
- Operating System (e.g. Windows, macOS, Ubuntu): any