File tree 6 files changed +19
-19
lines changed
6 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ $mat-mini-fab-padding: 8px !default;
66
66
%mat-raised-button {
67
67
@extend %mat-button-base ;
68
68
69
- @include mat-elevation (2 );
69
+ @include mat-overridable- elevation (2 );
70
70
71
71
// Force hardware acceleration.
72
72
transform : translate3d (0 , 0 , 0 );
@@ -76,7 +76,7 @@ $mat-mini-fab-padding: 8px !default;
76
76
mat-elevation-transition-property-value ();
77
77
78
78
& :not ([disabled ]):active {
79
- @include mat-elevation (8 );
79
+ @include mat-overridable- elevation (8 );
80
80
}
81
81
82
82
& [disabled ] {
@@ -88,7 +88,7 @@ $mat-mini-fab-padding: 8px !default;
88
88
@mixin mat-fab ($size , $padding ) {
89
89
@extend %mat-raised-button ;
90
90
91
- @include mat-elevation (6 );
91
+ @include mat-overridable- elevation (6 );
92
92
93
93
// Reset the min-width from the button base.
94
94
min-width : 0 ;
@@ -101,7 +101,7 @@ $mat-mini-fab-padding: 8px !default;
101
101
flex-shrink : 0 ;
102
102
103
103
& :not ([disabled ]):active {
104
- @include mat-elevation (12 );
104
+ @include mat-overridable- elevation (12 );
105
105
}
106
106
107
107
.mat-button-wrapper {
Original file line number Diff line number Diff line change @@ -10,15 +10,12 @@ $mat-card-header-size: 40px !default;
10
10
11
11
.mat-card {
12
12
@include mat-elevation-transition ;
13
+ @include mat-overridable-elevation (2 );
13
14
display : block ;
14
15
position : relative ;
15
16
padding : $mat-card-default-padding ;
16
17
border-radius : $mat-card-border-radius ;
17
18
18
- & :not ([class *= ' mat-elevation-z' ]) {
19
- @include mat-elevation (2 );
20
- }
21
-
22
19
@include cdk-high-contrast {
23
20
outline : solid 1px ;
24
21
}
Original file line number Diff line number Diff line change 19
19
// `mat-elevation-z$zValue` where `$zValue` corresponds to the z-space to which the element is
20
20
// elevated.
21
21
@for $zValue from 0 through 24 {
22
- .mat -elevation-z #{$zValue } {
22
+ .#{ $_mat -elevation-prefix } #{$zValue } {
23
23
@include mat-elevation ($zValue );
24
24
}
25
25
}
Original file line number Diff line number Diff line change @@ -126,6 +126,9 @@ $mat-elevation-transition-duration: 280ms !default;
126
126
// The default easing value for elevation transitions.
127
127
$mat-elevation-transition-timing-function : $mat-fast-out-slow-in-timing-function ;
128
128
129
+ // Prefix for elevation-related selectors.
130
+ $_mat-elevation-prefix : ' mat-elevation-z' ;
131
+
129
132
// Applies the correct css rules to an element to give it the elevation specified by $zValue.
130
133
// The $zValue must be between 0 and 24.
131
134
@mixin mat-elevation ($zValue ) {
@@ -141,6 +144,14 @@ $mat-elevation-transition-timing-function: $mat-fast-out-slow-in-timing-function
141
144
#{map-get ($_ambient-elevation-map , $zValue )} ;
142
145
}
143
146
147
+ // Applies the elevation to an element in a manner that allows
148
+ // consumers to override it via the Material elevation classes.
149
+ @mixin mat-overridable-elevation ($zValue ) {
150
+ & :not ([class *= ' #{$_mat-elevation-prefix}' ]) {
151
+ @include mat-elevation ($zValue );
152
+ }
153
+ }
154
+
144
155
// Returns a string that can be used as the value for a transition property for elevation.
145
156
// Calling this function directly is useful in situations where a component needs to transition
146
157
// more than one property.
Original file line number Diff line number Diff line change @@ -14,14 +14,9 @@ $mat-menu-icon-margin: 16px !default;
14
14
15
15
16
16
@mixin mat-menu-base ($default-elevation ) {
17
+ @include mat-overridable-elevation ($default-elevation );
17
18
min-width : $mat-menu-overlay-min-width ;
18
19
max-width : $mat-menu-overlay-max-width ;
19
-
20
- // Allow elevation to be overwritten.
21
- & :not ([class *= ' mat-elevation-z' ]) {
22
- @include mat-elevation ($default-elevation );
23
- }
24
-
25
20
overflow : auto ;
26
21
-webkit-overflow-scrolling : touch ; // for momentum scroll on mobile
27
22
}
Original file line number Diff line number Diff line change 3
3
4
4
.mat-expansion-panel {
5
5
@include mat-elevation-transition ;
6
+ @include mat-overridable-elevation (2 );
6
7
box-sizing : content-box ;
7
8
display : block ;
8
9
margin : 0 ;
9
10
transition : margin 225ms $mat-fast-out-slow-in-timing-function ;
10
-
11
- & :not ([class *= ' mat-elevation-z' ]) {
12
- @include mat-elevation (2 );
13
- }
14
11
}
15
12
16
13
.mat-expansion-panel-content {
You can’t perform that action at this time.
0 commit comments