mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(card): unable to override elevation (#3139)
Fixes an issue that prevents users from overriding the elevation of cards. The issue was introduced with the switch to the `mat-` prefix which changed the styling of cards from an element selector to a class, which has a higher specificity than the elevation classes. This change only adds the card shadow if it doesn't have an elevation class. Fixes #3123.
This commit is contained in:
committed by
Andrew Seguin
parent
6e1f50bc82
commit
4ee16a9387
@@ -9,7 +9,6 @@ $mat-card-border-radius: 2px !default;
|
||||
$mat-card-header-size: 40px !default;
|
||||
|
||||
.mat-card {
|
||||
@include mat-elevation(2);
|
||||
@include mat-elevation-transition;
|
||||
display: block;
|
||||
position: relative;
|
||||
@@ -17,6 +16,10 @@ $mat-card-header-size: 40px !default;
|
||||
border-radius: $mat-card-border-radius;
|
||||
font-family: $mat-font-family;
|
||||
|
||||
&:not([class*='mat-elevation-z']) {
|
||||
@include mat-elevation(2);
|
||||
}
|
||||
|
||||
@include cdk-high-contrast {
|
||||
outline: solid 1px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user