From 857c2171cec3f08a4a6ea135bbb384d850aadc02 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 11 Apr 2017 08:54:57 -0700 Subject: [PATCH] perf(dialog): switch dialog animations to translate3d (#3905) * Switches the `translate` to `translate3d` for hardware accelerated animations. --- src/lib/dialog/dialog-container.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/dialog/dialog-container.ts b/src/lib/dialog/dialog-container.ts index 9bd64ca3a2f..1416d36a7bb 100644 --- a/src/lib/dialog/dialog-container.ts +++ b/src/lib/dialog/dialog-container.ts @@ -41,9 +41,9 @@ export type MdDialogContainerAnimationState = 'void' | 'enter' | 'exit' | 'exit- encapsulation: ViewEncapsulation.None, animations: [ trigger('slideDialog', [ - state('void', style({ transform: 'translateY(25%) scale(0.9)', opacity: 0 })), - state('enter', style({ transform: 'translateY(0%) scale(1)', opacity: 1 })), - state('exit', style({ transform: 'translateY(25%)', opacity: 0 })), + state('void', style({ transform: 'translate3d(0, 25%, 0) scale(0.9)', opacity: 0 })), + state('enter', style({ transform: 'translate3d(0, 0, 0) scale(1)', opacity: 1 })), + state('exit', style({ transform: 'translate3d(0, 25%, 0)', opacity: 0 })), transition('* => *', animate('400ms cubic-bezier(0.25, 0.8, 0.25, 1)')), ]) ],