File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,21 @@ $prefix: 'mat-elevation-z';
38
38
// Applies the correct css rules to an element to give it the elevation specified by $zValue.
39
39
// The $zValue must be between 0 and 24.
40
40
@mixin elevation ($zValue , $color : $color ) {
41
- @include mdc-elevation .elevation ($zValue , $color );
41
+ @if meta .type-of ($color ) == color {
42
+ @include mdc-elevation .elevation ($zValue , $color );
43
+ } @else {
44
+ // Copied from @material/elevation/_elevation-theme.scss#_box-shadow
45
+ // TODO(mmalerba): Add support for graceful handling of CSS var color to MDC.
46
+ $umbra-z-value : map .get (mdc-elevation .$umbra-map , $zValue );
47
+ $penumbra-z-value : map .get (mdc-elevation .$penumbra-map , $zValue );
48
+ $ambient-z-value : map .get (mdc-elevation .$ambient-map , $zValue );
49
+ $box-shadow : (
50
+ #{' #{$umbra-z-value } #{$color } ' } ,
51
+ #{' #{$penumbra-z-value } #{$color } ' } ,
52
+ #{$ambient-z-value } $color
53
+ );
54
+ @include mdc-elevation .shadow ($box-shadow );
55
+ }
42
56
}
43
57
44
58
// Applies the elevation to an element in a manner that allows
You can’t perform that action at this time.
0 commit comments