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:
Kristiyan Kostadinov
2017-02-17 00:42:32 +01:00
committed by Andrew Seguin
parent 6e1f50bc82
commit 4ee16a9387
+4 -1
View File
@@ -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;
}