Skip to content

Commit

Permalink
fix(snack-bar): add content fade in animation (#7504)
Browse files Browse the repository at this point in the history
  • Loading branch information
crisbeto authored and kara committed Oct 6, 2017
1 parent 5eb5cbd commit 2b9c470
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/snack-bar/simple-snack-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $mat-snack-bar-button-margin: 48px !default;
display: flex;
justify-content: space-between;
line-height: 20px;
opacity: 1;
}

.mat-simple-snackbar-action {
Expand Down
11 changes: 11 additions & 0 deletions src/lib/snack-bar/simple-snack-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*/

import {Component, ViewEncapsulation, Inject, ChangeDetectionStrategy} from '@angular/core';
import {trigger, style, transition, animate} from '@angular/animations';
import {AnimationCurves, AnimationDurations} from '@angular/material/core';
import {MatSnackBarRef} from './snack-bar-ref';
import {MAT_SNACK_BAR_DATA} from './snack-bar-config';

Expand All @@ -23,7 +25,16 @@ import {MAT_SNACK_BAR_DATA} from './snack-bar-config';
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [
trigger('contentFade', [
transition(':enter', [
style({opacity: '0'}),
animate(`${AnimationDurations.COMPLEX} ${AnimationCurves.STANDARD_CURVE}`)
])
])
],
host: {
'[@contentFade]': '',
'class': 'mat-simple-snackbar',
}
})
Expand Down

0 comments on commit 2b9c470

Please sign in to comment.