Skip to content

Commit 32456e3

Browse files
crisbetojelbourn
authored andcommitted
feat(datepicker): align with 2018 material design spec (#12693)
Aligns the datepicker panel with the latest Material Design spec. Note that this only handles the datepicker in popup mode, the touch mode will be handled when we align the dialog.
1 parent 37a7056 commit 32456e3

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/lib/datepicker/datepicker-animations.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import {
1212
transition,
1313
trigger,
1414
AnimationTriggerMetadata,
15-
group,
16-
query,
17-
animateChild,
1815
} from '@angular/animations';
1916

2017
/** Animations used by the Material datepicker. */
@@ -24,19 +21,24 @@ export const matDatepickerAnimations: {
2421
} = {
2522
/** Transforms the height of the datepicker's calendar. */
2623
transformPanel: trigger('transformPanel', [
27-
state('void', style({opacity: 0, transform: 'scale(1, 0)'})),
28-
state('enter', style({opacity: 1, transform: 'scale(1, 1)'})),
29-
transition('void => enter', group([
30-
query('@fadeInCalendar', animateChild()),
31-
animate('400ms cubic-bezier(0.25, 0.8, 0.25, 1)')
32-
])),
24+
state('void', style({
25+
opacity: 0,
26+
transform: 'scale(1, 0.8)'
27+
})),
28+
transition('void => enter', animate('120ms cubic-bezier(0, 0, 0.2, 1)', style({
29+
opacity: 1,
30+
transform: 'scale(1, 1)'
31+
}))),
3332
transition('* => void', animate('100ms linear', style({opacity: 0})))
3433
]),
3534

3635
/** Fades in the content of the calendar. */
3736
fadeInCalendar: trigger('fadeInCalendar', [
3837
state('void', style({opacity: 0})),
3938
state('enter', style({opacity: 1})),
40-
transition('void => *', animate('400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)'))
39+
40+
// TODO(crisbeto): this animation should be removed since it isn't quite on spec, but we
41+
// need to keep it until #12440 gets in, otherwise the exit animation will look glitchy.
42+
transition('void => *', animate('120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)'))
4143
])
4244
};

src/lib/datepicker/datepicker-content.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ $mat-datepicker-touch-max-height: 788px;
2525

2626

2727
.mat-datepicker-content {
28-
@include mat-elevation(8);
28+
@include mat-elevation(4);
2929

3030
display: block;
31-
border-radius: 2px;
31+
border-radius: 4px;
3232

3333
.mat-calendar {
3434
width: $mat-datepicker-non-touch-calendar-width;

0 commit comments

Comments
 (0)