File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
@import ' ../core/style/variables' ;
2
2
@import ' ../core/style/elevation' ;
3
+ @import ' ../core/style/noop-animation' ;
3
4
@import ' ../../cdk/a11y/a11y' ;
4
5
5
6
@@ -11,6 +12,7 @@ $mat-card-header-size: 40px !default;
11
12
.mat-card {
12
13
@include mat-elevation-transition ;
13
14
@include mat-overridable-elevation (2 );
15
+ @include _noop-animation ();
14
16
display : block ;
15
17
position : relative ;
16
18
padding : $mat-card-default-padding ;
Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ import {
12
12
ChangeDetectionStrategy ,
13
13
Directive ,
14
14
Input ,
15
+ Optional ,
16
+ Inject ,
15
17
} from '@angular/core' ;
18
+ import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations' ;
16
19
17
20
18
21
/**
@@ -156,9 +159,15 @@ export class MatCardAvatar {}
156
159
styleUrls : [ 'card.css' ] ,
157
160
encapsulation : ViewEncapsulation . None ,
158
161
changeDetection : ChangeDetectionStrategy . OnPush ,
159
- host : { 'class' : 'mat-card' }
162
+ host : {
163
+ 'class' : 'mat-card' ,
164
+ '[class._mat-animation-noopable]' : '_animationMode === "NoopAnimations"' ,
165
+ }
160
166
} )
161
- export class MatCard { }
167
+ export class MatCard {
168
+ // @deletion -target 7.0.0 `_animationMode` parameter to be made required.
169
+ constructor ( @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) public _animationMode ?: string ) { }
170
+ }
162
171
163
172
164
173
/**
You can’t perform that action at this time.
0 commit comments