I cannot figure out why I have been struggling with this issue all afternoon. It's frustrating that something so seemingly simple is proving to be difficult in angular material.
My goal is to add a custom style to a snackbar when a button is clicked. Here is the code I am using:
this.errormessagecard.open(error.error.message,'Esci', {panelClass : 'error-snackbar'});
I have tried every possible solution:
In my component.css
.error-snackbar{
background-color: red!important;
}
error-snackbar{
background-color: red!important;
}
::ng-deep .error-snackbar{
background-color: red!important;
I have also attempted the same changes in my styles.css
However, no matter what I do, the result remains unchanged:
Why won't it change? What am I missing?