Skip to content

Commit 4e358c3

Browse files
crisbetommalerba
authored andcommitted
feat(tooltip): align with 2018 material design spec (#12310)
Adjusts the tooltip to align it with the new Material design spec.
1 parent e074003 commit 4e358c3

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/lib/tooltip/_tooltip-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $mat-tooltip-target-height: 22px;
66
$mat-tooltip-font-size: 10px;
77
$mat-tooltip-vertical-padding: ($mat-tooltip-target-height - $mat-tooltip-font-size) / 2;
88

9-
$mat-tooltip-handset-target-height: 32px;
9+
$mat-tooltip-handset-target-height: 30px;
1010
$mat-tooltip-handset-font-size: 14px;
1111
$mat-tooltip-handset-vertical-padding:
1212
($mat-tooltip-handset-target-height - $mat-tooltip-handset-font-size) / 2;

src/lib/tooltip/tooltip-animations.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
*/
88
import {
99
animate,
10+
AnimationTriggerMetadata,
11+
keyframes,
1012
state,
1113
style,
1214
transition,
1315
trigger,
14-
AnimationTriggerMetadata,
1516
} from '@angular/animations';
1617

1718
/** Animations used by MatTooltip. */
@@ -20,9 +21,13 @@ export const matTooltipAnimations: {
2021
} = {
2122
/** Animation that transitions a tooltip in and out. */
2223
tooltipState: trigger('state', [
23-
state('initial, void, hidden', style({transform: 'scale(0)'})),
24+
state('initial, void, hidden', style({opacity: 0, transform: 'scale(0)'})),
2425
state('visible', style({transform: 'scale(1)'})),
25-
transition('* => visible', animate('150ms cubic-bezier(0.0, 0.0, 0.2, 1)')),
26-
transition('* => hidden', animate('150ms cubic-bezier(0.4, 0.0, 1, 1)')),
26+
transition('* => visible', animate('200ms cubic-bezier(0, 0, 0.2, 1)', keyframes([
27+
style({opacity: 0, transform: 'scale(0)', offset: 0}),
28+
style({opacity: 0.5, transform: 'scale(0.99)', offset: 0.5}),
29+
style({opacity: 1, transform: 'scale(1)', offset: 1})
30+
]))),
31+
transition('* => hidden', animate('100ms cubic-bezier(0, 0, 0.2, 1)', style({opacity: 0}))),
2732
])
2833
};

src/lib/tooltip/tooltip.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $mat-tooltip-handset-margin: 24px;
1717

1818
.mat-tooltip {
1919
color: white;
20-
border-radius: 2px;
20+
border-radius: 4px;
2121
margin: $mat-tooltip-margin;
2222
max-width: $mat-tooltip-max-width;
2323
padding-left: $mat-tooltip-horizontal-padding;

0 commit comments

Comments
 (0)