角材质卡阴影颜色

时间:2019-03-20 17:15:29

标签: angular angular-material

有什么方法可以改变卡下较暗的阴影的颜色?

如果有任何解决方案,请告诉我或任何其他解决方法,谢谢!

enter image description here

2 个答案:

答案 0 :(得分:3)

在CSS中添加以下内容将box-shadow更改为mat-card

.mat-card:not([class*=mat-elevation-z]) {
    box-shadow: 0 2px 1px -1px rgba(0,0,0,1), 
                0 1px 1px 0 rgba(0,0,0,1), 
                0 1px 3px 0 rgba(0,0,0,1);
}

如果您使用的是海拔,那么当然需要对CSS进行一些修改。

Stackblitz

https://stackblitz.com/edit/angular-yxb2ow?embed=1&file=app/card-overview-example.css

答案 1 :(得分:0)

看看最新的angular material elevation

您可以在style.sass中做类似的事情

@import '~@angular/material/theming';

.my-class-with-custom-shadow {
  // Adds a shadow for elevation level 2 with color #e91e63 and 80% of the default opacity:
  @include mat-elevation(2, #e91e63, 0.8);
}
相关问题