Skip to content

Commit

Permalink
fix(card): unable to override elevation (#3139)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
crisbeto authored and andrewseguin committed Feb 16, 2017
1 parent 6e1f50b commit 4ee16a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/card/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ $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;
padding: $mat-card-default-padding;
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;
}
Expand Down

0 comments on commit 4ee16a9

Please sign in to comment.