forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathautocomplete.scss
78 lines (65 loc) · 2.22 KB
/
autocomplete.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@use '@angular/cdk';
@use './m2-autocomplete';
@use '../core/tokens/token-utils';
$token-prefix: m2-autocomplete.$prefix;
$token-slots: m2-autocomplete.get-token-slots();
// Even though we don't use the MDC styles, we need to keep the classes in the
// DOM for the Gmat versions to work. We need to bump up the specificity here
// so that it's higher than MDC's styles.
div.mat-mdc-autocomplete-panel {
width: 100%; // Ensures that the panel matches the overlay width.
max-height: 256px; // Prevents lists with a lot of option from growing too high.
visibility: hidden;
transform-origin: center top;
overflow: auto;
padding: 8px 0;
box-sizing: border-box;
// Necessary so the `offsetParent` of the nested `mat-option` is the
// panel which is required for scroll calculations (see #30974).
position: relative;
@include token-utils.use-tokens($token-prefix, $token-slots) {
border-radius: token-utils.slot(container-shape);
box-shadow: token-utils.slot(container-elevation-shadow);
background-color: token-utils.slot(background-color);
}
@include cdk.high-contrast {
outline: solid 1px;
}
.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) & {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.mat-mdc-autocomplete-panel-above & {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
transform-origin: center bottom;
}
// These classes are used to toggle the panel visibility depending on whether it has any options.
&.mat-mdc-autocomplete-visible {
visibility: visible;
}
&.mat-mdc-autocomplete-hidden {
visibility: hidden;
pointer-events: none;
}
}
@keyframes _mat-autocomplete-enter {
from {
opacity: 0;
transform: scaleY(0.8);
}
to {
opacity: 1;
transform: none;
}
}
// Note: the autocomplete intentionally only implements an enter animation.
// The exit animation can look glitchy, because usually selecting an option
// causes the list to change and jump around while it's animating.
.mat-autocomplete-panel-animations-enabled {
animation: _mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1);
}
// Prevent the overlay host node from affecting its surrounding layout.
mat-autocomplete {
display: none;
}