@@ -2,89 +2,137 @@ $icon-search: "data:image/svg+xml;utf8,<svg width=\'22\' height=\'22\' viewBox=\
22$pale-grey : #f2f4f6 ;
33$greyish : #a4a4a4 ;
44
5+ $browser-context : 16 ; // Default
6+
7+ @function em ($pixels , $context : $browser-context ) {
8+ @return #{$pixels / $context } em;
9+ }
10+
11+ @mixin placeholder {
12+ $placeholders : " :-webkit-input" " :-moz" " -moz" " -ms-input" ;
13+ @each $placeholder in $placeholders {
14+ & :#{$placeholder } - placeholder {
15+ @content ;
16+ }
17+ }
18+ }
19+
20+
521// all em units are computed given a font of 16px
622// see http://pxtoem.com/ to change/add values
723.algolia-places {
8- width : 100% ; // we ask the autocomplete to take the full width of his container
24+ width : 100% ;
925
10- .aa-hint {color : #dedede }
26+ .aa-input ,
27+ .aa-hint {
28+ padding : em (12 ) em (16 );
29+ border-radius : 3px ;
30+ line-height : em (40 );
31+ height : 40px ;
32+ }
1133
1234 .aa-input {
13- border : solid 0.063em rgba (255 , 255 , 255 , 0.5 );
14- box-shadow : 0 0.063em 0.625em rgba (0 , 0 , 0 , 0.2 ), 0 0.125em 0.250em 0 rgba (0 , 0 , 0 , 0.1 );
35+ position : relative ;
36+ width : 100% ;
37+ overflow : hidden ;
38+ -webkit-appearance : none ;
39+ -moz-appearance : none ;
40+ appearance : none ;
41+ border : em (1 ) solid #ccc ;
42+ color : #555555 ;
43+
1544 background : {
16- image : url ($icon-search );
45+ image : url (" data:image/svg+xml;utf8,<svg width= \' 14 \' height= \' 20 \' viewBox= \' 0 0 14 20 \' xmlns= \' http://www.w3.org/2000/svg \' ><path d= \' M7 0C3.13 0 0 3.13 0 7c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5C5.62 9.5 4.5 8.38 4.5 7S5.62 4.5 7 4.5 9.5 5.62 9.5 7 8.38 9.5 7 9.5z \' fill= \' %23CFCFCF \' fill-rule= \' evenodd \' /></svg> " );
1746 repeat : no-repeat ;
18- position : center right 1em ;
47+ position : center right 16px ;
48+ size : 14px ;
1949 }
20- }
2150
22- .aa-input , .aa-hint {
23- width : 100% ;
24- height : 3.5em ;
25- padding-left : 1em ;
26- padding-right : 3em ;
27- border-radius : 0.250em ;
51+ & :hover ,
52+ & :focus {
53+ border-color : #999 ;
54+ background : {
55+ image : url (" data:image/svg+xml;utf8,<svg width=\' 14\' height=\' 20\' viewBox=\' 0 0 14 20\' xmlns=\' http://www.w3.org/2000/svg\' ><path d=\' M7 0C3.13 0 0 3.13 0 7c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5C5.62 9.5 4.5 8.38 4.5 7S5.62 4.5 7 4.5 9.5 5.62 9.5 7 8.38 9.5 7 9.5z\' fill=\' %23AAAAAA\' fill-rule=\' evenodd\' /></svg>" );
56+ repeat : no-repeat ;
57+ position : center right 16px ;
58+ size : 14px ;
59+ }
60+ }
61+
62+ @include placeholder {
63+ font-size : 14px ;
64+ color : #aaaaaa ;
65+ }
2866 }
2967
30- .aa-dropdown-menu {
68+ .aa-hint {
3169 width : 100% ;
32- background : #ffffff ;
33- box-shadow : 0 0.063em 0.625em rgba (0 , 0 , 0 , 0.2 ), 0 0.125em 0.250em 0 rgba (0 , 0 , 0 , 0.1 );
34- border-radius : 0.250em ;
35- margin-top : 0.250em ;
70+ height : 100% ;
71+ color : lighten (#555555 , 35% );
72+ border : 1px solid transparent ;
3673 }
3774
38- .aa-suggestion {
39- cursor : pointer ;
40- height : 2.875em ;
41- line-height : 2.875em ;
42- padding-left : 1.125em ;
43- em {
44- font-weight : bold ;
45- font-style : normal ;
75+ // Dropdown
76+ .aa-dropdown-menu {
77+ width : 100% ;
78+ background : #ffffff ;
79+ box-shadow : 0 em (1 ) em (10 ) rgba (0 , 0 , 0 , 0.2 ), 0 em (2 ) em (4 ) 0 rgba (0 , 0 , 0 , 0.1 );
80+ border-radius : em (4 );
81+ margin-top : em (4 );
4682 }
4783
48- & :first-child {
49- border-top-left-radius : 0.250em ;
50- border-top-right-radius : 0.250em ;
51- }
84+ .aa-suggestion {
85+ cursor : pointer ;
86+ height : em (46 );
87+ line-height : em (46 );
88+ padding-left : em (18 );
89+ overflow : hidden ;
5290
53- & :last-child {
54- border-bottom-left-radius : 0.250em ;
55- border-bottom-right-radius : 0.250em ;
56- }
57- }
91+ em {
92+ font-weight : bold ;
93+ font-style : normal ;
94+ }
5895
59- .pl-address {
60- font-size : 0.875em ; // 14px when font is 16px
61- margin-left : 0.857em ; // 12px when font is 14px
62- color : $greyish ;
63- }
96+ & :first-child {
97+ border-top-left-radius : em (4 );
98+ border-top-right-radius : em (4 );
99+ }
64100
65- .pl-icon {
66- max-width : 0.875em ;
67- max-height : 1.250em ;
68- margin-right : 0.625em ;
69- float : left ;
70- position : relative ;
71- top : 50% ;
72- transform : translateY (-50% );
101+ & :last-child {
102+ border-bottom-left-radius : em (4 );
103+ border-bottom-right-radius : em (4 );
104+ }
105+ }
73106
74- svg {
75- transform : scale (0.90 );
107+ .pl-address {
108+ font-size : em (14 ); // 14px when font is 16px
109+ margin-left : em (13 ); // 12px when font is 14px
110+ color : $greyish ;
76111 }
77- }
78112
79- .aa-cursor {
80- background : $pale-grey ;
113+ .pl-icon {
114+ max-width : em (14 );
115+ max-height : em (20 );
116+ margin-right : em (10 );
117+ float : left ;
118+ position : relative ;
119+ top : 50% ;
120+ transform : translateY (-50% );
81121
82- .pl-address {
83- color : darken ($greyish , 10% )
122+ svg {
123+ transform : scale (0.90 );
124+ }
84125 }
85126
86- .pl-icon svg {
87- transform : scale (1 )
127+ .aa-cursor {
128+ background : $pale-grey ;
129+
130+ .pl-address {
131+ color : darken ($greyish , 10% )
132+ }
133+
134+ .pl-icon svg {
135+ transform : scale (1 )
136+ }
88137 }
89- }
90- }
138+ }
0 commit comments