1
1
@import ' ~styles/utils/modules-entry' ;
2
+
2
3
$icon-size : $font-size-lg ;
3
- $input-width : 2rem ;
4
- $input-width-open : 21rem ;
5
- $input-width-open-lg : 34rem ;
4
+ $input-width : 14rem ;
5
+ $input-width-lg : 18rem ;
6
+ $results-width-open : 21rem ;
7
+ $results-width-open-lg : 34rem ;
8
+ $container-vertical-margin : 0.3rem ;
6
9
$container-padding : 0.5rem ;
7
10
$dropdown-height : 40rem ;
8
11
12
+ $container-height : $navbar-height - $container-vertical-margin * 2 ;
13
+ $internal-padding : ($container-height - $icon-size ) / 2 ;
14
+
9
15
.container {
10
16
composes : btn- svg from global;
11
17
position : relative ;
12
- height : 100% ;
13
- padding-left : $container-padding ;
14
- margin-left : auto ;
15
18
font-size : 0.9rem ;
16
19
17
- & :hover .icon {
20
+ background-color : var (--gray-lightest );
21
+ border-radius : $container-height / 2 ;
22
+ margin : $container-vertical-margin $container-padding ;
23
+
24
+ border & :hover .icon {
18
25
color : theme-color ();
19
26
}
20
27
}
21
28
22
- $icon-dist : $input-width-open - $input-width ;
23
- $icon-dist-lg : $input-width-open-lg - $input-width ;
24
-
25
29
.icon {
26
- // position: absolute;
27
- // right: $icon-dist + $container-padding;
28
- // position: relative;
29
- // left: 0;
30
30
width : $icon-size ;
31
31
height : $icon-size ;
32
- // transform: translate($icon-dist - 0.25rem) ;
32
+ margin : 0 $internal-padding ;
33
33
transition : all $desktop-entering-duration $material-deceleration-curve ;
34
34
35
- @include media-breakpoint-up (lg) {
36
- // right: $icon-dist-lg + $container-padding;
37
- // transform: translate($icon-dist-lg - 0.25rem);
35
+ & .iconOpen {
36
+ color : theme-color ();
38
37
}
39
38
}
40
39
41
- .iconOpen {
42
- color : theme-color ();
43
- // transform: translate(0);
44
- }
45
-
46
40
.input {
47
- $overhang : $icon-size / 2 ; // Extend clickable area to the left of icon
48
- $internal-padding : $overhang ; // Symmetrical padding around icon
49
-
50
41
position : relative ;
51
- opacity : 0 ;
52
- left : - $icon-size - $overhang ;
53
- padding-left : $icon-size + $overhang + $internal-padding ;
54
- width : $input-width + $overhang + $internal-padding ;
42
+ width : 0 ;
55
43
height : 100% ;
44
+ padding : 0 ;
56
45
57
46
border : 0 ;
58
47
font-size : $font-size-s ;
59
48
color : var (--body-color );
60
49
background : transparent ;
61
50
cursor : pointer ;
62
- // transform: translate($input-width-open);
63
- transition : transform $desktop-entering-duration $material-deceleration-curve ,
64
- opacity $desktop-entering-duration $material-deceleration-curve 75ms ;
51
+
52
+ // Because .input is the "button" that opens the search, we extend input to
53
+ // the left of icon so that it looks like the icon is clickable.
54
+ $overhang : $icon-size + $internal-padding * 2 ;
55
+ padding-left : $overhang ;
56
+ margin-left : - $overhang ;
65
57
66
58
& :focus {
67
59
outline : none ;
@@ -70,23 +62,29 @@ $icon-dist-lg: $input-width-open-lg - $input-width;
70
62
}
71
63
}
72
64
73
- .openWidth {
74
- width : $input-width-open ;
65
+ .inputOpen {
66
+ cursor : auto ;
67
+
68
+ width : $input-width ;
75
69
76
70
@include media-breakpoint-up (lg) {
77
- width : $input-width-open- lg ;
71
+ width : $input-width-lg ;
78
72
}
79
73
}
80
74
81
- .inputOpen {
82
- composes : openWidth;
83
- opacity : 1 ;
84
- cursor : auto ;
75
+ .resultsWidth {
76
+ margin-right : $internal-padding ;
77
+ width : $results-width-open ;
78
+
79
+ @include media-breakpoint-up (lg) {
80
+ width : $results-width-open-lg ;
81
+ }
85
82
}
86
83
87
84
.selectListContainer {
88
85
position : absolute ;
89
86
top : $navbar-height ;
87
+ left : 0 ;
90
88
z-index : $module-select-z-index ;
91
89
border : $input-btn-border-width solid $input-border-color ;
92
90
border-width : 0 $input-btn-border-width $input-btn-border-width ;
@@ -104,7 +102,7 @@ $icon-dist-lg: $input-width-open-lg - $input-width;
104
102
}
105
103
106
104
.item {
107
- composes : openWidth ;
105
+ composes : resultsWidth ;
108
106
display : flex ;
109
107
justify-content : space-between ;
110
108
padding : 0.6rem $container-padding ;
@@ -155,7 +153,7 @@ $icon-dist-lg: $input-width-open-lg - $input-width;
155
153
}
156
154
157
155
.noResults {
158
- composes : openWidth ;
156
+ composes : resultsWidth ;
159
157
text-align : center ;
160
158
161
159
p {
0 commit comments