Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 6caeb85

Browse files
author
vvo
committed
fix(default style): small cleaning/rework of default style
1 parent 71d080b commit 6caeb85

File tree

3 files changed

+67
-105
lines changed

3 files changed

+67
-105
lines changed

docs/source/searchbox.html.haml

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/source/stylesheets/components/_inputs.scss

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,43 @@ input {
66
.algolia-places {
77
top: 50px;
88
font-family: 'Open Sans', helvetica Neue;
9-
width: 100%; // we ask the autocomplete to take the full width of his container
109

1110
&:before {
12-
content:'Try me!';
11+
content:'Try it!';
1312
position: absolute;
1413
top: -44px;
15-
left: 10px;
14+
left: 2px;
1615
width: 100px;
1716
height: 44px;
1817
text-align: right;
1918
font-style: italic;
2019
font-weight: 600;
21-
font-family: 'Open Sans', helvetica Neue;
22-
font-size: 16px;
2320
line-height: 44px;
2421
color: $powder-blue;
2522
background: {
2623
image: url($icon-arrow);
2724
repeat: no-repeat;
28-
position: bottom 12px left 12px;
25+
position: bottom 12px left 24px;
2926
size: 24px;
3027
}
3128
}
3229

3330
.aa-input {
34-
border: solid em(1) rgba(255, 255, 255, 0.5);
35-
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);
31+
border: solid 1px rgba(255, 255, 255, 0.5);
32+
box-shadow: 0 1px 10px rgba(0, 0, 0, 0.2), 0 2px 4px 0 rgba(0, 0, 0, 0.1);
3633
color: #8f94ad;
37-
font-family: "Raleway", Helvetica Neue, helvetica;
3834
}
3935

4036
.aa-input, .aa-hint {
41-
width: 100%;
42-
height: em(56);
43-
padding-left: em(16);
44-
padding-right: em(48);
45-
border-radius: em(4);
37+
font-family: "Raleway", Helvetica Neue, helvetica;
38+
height: 56px;
39+
padding-left: 16px;
40+
padding-right: 48px;
41+
border-radius: 4px;
4642
}
4743

4844
.aa-suggestion {
4945
color: #262626;
5046
}
5147
}
52-
}
48+
}

src/places.scss

Lines changed: 56 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
$icon-search: "data:image/svg+xml;utf8,<svg width=\'22\' height=\'22\' viewBox=\'0 0 22 22\' xmlns=\'http://www.w3.org/2000/svg\'><title>search-icon copy</title><path d=\'M15.723 13.836h-.993l-.353-.34c1.233-1.433 1.975-3.295 1.975-5.32C16.352 3.66 12.692 0 8.176 0S0 3.66 0 8.176s3.66 8.176 8.176 8.176c2.025 0 3.887-.742 5.32-1.975l.34.353v.993L20.126 22 22 20.126l-6.277-6.29zm-7.547 0c-3.132 0-5.66-2.528-5.66-5.66s2.528-5.66 5.66-5.66 5.66 2.528 5.66 5.66-2.528 5.66-5.66 5.66z\' fill=\'%23A3A3A3\' fill-rule=\'evenodd\'/></svg>";
2-
$pale-grey: #f2f4f6;
3-
$greyish: #a4a4a4;
4-
5-
$browser-context: 16; // Default
6-
7-
@function em($pixels, $context: $browser-context) {
8-
@return #{$pixels/$context}em;
9-
}
1+
$icon-pin: '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>';
2+
$icon-pin-hover: '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>';
103

114
@mixin placeholder {
125
$placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input";
@@ -17,122 +10,99 @@ $browser-context: 16; // Default
1710
}
1811
}
1912

20-
2113
// all em units are computed given a font of 16px
2214
// see http://pxtoem.com/ to change/add values
2315
.algolia-places {
2416
width: 100%;
2517

2618
.aa-input,
27-
.aa-hint{
28-
padding: em(12) em(16);
29-
border-radius: 3px;
30-
line-height: em(40);
19+
.aa-hint {
20+
box-sizing: border-box;
21+
width: 100%;
22+
padding-left: 16px;
23+
padding-right: 30px;
24+
line-height: 40px;
3125
height: 40px;
26+
// it's necessary to specify border for both inputs to get the exact same dimensions and
27+
// avoid font overlaps
28+
border: 1px solid #cccccc;
29+
border-radius: 3px;
30+
outline: none;
3231
}
3332

3433
.aa-input {
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;
4234
color: #555555;
4335

4436
background: {
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>");
37+
image: url($icon-pin);
4638
repeat: no-repeat;
4739
position: center right 16px;
4840
size: 14px;
4941
}
5042

5143
&:hover,
5244
&:focus {
53-
border-color: #999;
45+
border-color: #999999;
5446
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;
47+
image: url($icon-pin-hover);
5948
}
6049
}
6150

6251
@include placeholder {
63-
font-size: 14px;
64-
color: #aaaaaa;
52+
color: #cccccc;
6553
}
6654
}
6755

6856
.aa-hint {
69-
width: 100%;
70-
height: 100%;
71-
color: lighten(#555555, 35%);
72-
border: 1px solid transparent;
57+
color: #cccccc;
58+
background: #ffffff;
7359
}
7460

7561
// Dropdown
7662
.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);
82-
}
83-
84-
.aa-suggestion {
85-
cursor: pointer;
86-
height: em(46);
87-
line-height: em(46);
88-
padding-left: em(18);
89-
overflow: hidden;
90-
91-
em {
92-
font-weight: bold;
93-
font-style: normal;
94-
}
63+
width: 100%;
64+
background: #ffffff;
65+
box-shadow: 0 1px 10px rgba(0, 0, 0, 0.2), 0 2px 4px 0 rgba(0, 0, 0, 0.1);
66+
border-radius: 3px;
67+
margin-top: 3px;
68+
overflow: hidden; // avoid non rounded borders to overlap
69+
}
9570

96-
&:first-child {
97-
border-top-left-radius: em(4);
98-
border-top-right-radius: em(4);
99-
}
71+
.aa-suggestion {
72+
cursor: pointer;
73+
height: 46px;
74+
line-height: 46px;
75+
padding-left: 18px;
76+
overflow: hidden;
10077

101-
&:last-child {
102-
border-bottom-left-radius: em(4);
103-
border-bottom-right-radius: em(4);
104-
}
78+
em {
79+
font-weight: bold;
80+
font-style: normal;
10581
}
82+
}
10683

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;
111-
}
84+
.pl-address {
85+
font-size: smaller;
86+
margin-left: 12px; // 12px when font is 14px
87+
color: #aaaaaa;
88+
}
11289

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%);
121-
122-
svg {
123-
transform: scale(0.90);
124-
}
125-
}
90+
.pl-icon {
91+
margin-right: 10px;
92+
display: inline-block;
93+
width: 14px;
12694

127-
.aa-cursor {
128-
background: $pale-grey;
95+
svg {
96+
transform: scale(0.90);
97+
vertical-align: text-bottom;
98+
}
99+
}
129100

130-
.pl-address {
131-
color: darken($greyish, 10%)
132-
}
101+
.aa-cursor {
102+
background: #efefef;
133103

134-
.pl-icon svg {
135-
transform: scale(1)
136-
}
104+
.pl-icon svg {
105+
transform: scale(1)
137106
}
138-
}
107+
}
108+
}

0 commit comments

Comments
 (0)