From 3ddf080e768343b92b1400f6d627c41b5365e5ae Mon Sep 17 00:00:00 2001 From: crisbeto Date: Thu, 16 Feb 2017 21:03:38 +0100 Subject: [PATCH] fix(card): unable to override elevation 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 c7a6444bba34..56b3b4816025 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; }