From 4ee16a93877af706dca13232d3cc1b9117bd782e Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Fri, 17 Feb 2017 00:42:32 +0100 Subject: [PATCH] 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. --- src/lib/card/card.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/card/card.scss b/src/lib/card/card.scss index c7a6444bba3..56b3b481602 100644 --- a/src/lib/card/card.scss +++ b/src/lib/card/card.scss @@ -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; }