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

Commit d770d89

Browse files
committed
feat(styling): Change the way to styling is done
Disable all <input /> border/shadow/padding styling, we want to fix the page styles. Add a new `style: boolean` option to control whether the input and dropdown menu should be styled or not. Fix #91
1 parent 95925cf commit d770d89

File tree

13 files changed

+43
-117
lines changed

13 files changed

+43
-117
lines changed

docs/source/layouts/nostyle.erb

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

docs/source/nostyle.html.erb

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

docs/source/partials/documentation.md.erb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var placesAutocomplete = places({
4242

4343
As a result, you will get the Algolia Places autocompletion menu:
4444

45-
<input type="text" id="docs-getting-started-demo" placeholder="Where are we going?" />
45+
<input type="text" id="docs-getting-started-demo" class="form-control" placeholder="Where are we going?" />
4646

4747
## API
4848

@@ -126,6 +126,20 @@ if you want to configure this.
126126
**Default**: Search in all types.
127127

128128
FIXME: not implemented
129+
</td>
130+
</tr>
131+
<tr>
132+
<td markdown="1">
133+
`style`
134+
135+
Type: boolean
136+
137+
required: no
138+
</td>
139+
<td markdown="1">
140+
Control whether the default styles should be used.
141+
142+
**Default**: Styles are enabled.
129143
</td>
130144
</tr>
131145
</tbody>

docs/source/partials/examples/_address_form.html.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<form action="/billing" class="billing-form">
1+
<form action="/billing" class="form">
22
<div class="form-group">
33
<label for="form-address">Address*</label>
44
<input type="text" class="form-control" id="form-address" placeholder="Where do you live?" />
@@ -15,7 +15,6 @@
1515
<label for="form-zip">Zip Code*</label>
1616
<input type="text" class="form-control" id="form-zip" placeholder="Zip Code">
1717
</div>
18-
<button type="submit" class="btn btn-default">Save</button>
1918
</form>
2019

2120
<script>

docs/source/partials/examples/_address_map.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<link rel="stylesheet" href="//cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
22
<script src="//cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
3-
<div id="map-example">
3+
<div id="map-example" class="form-group">
44
<div class="left-column">
5-
<input type="text" id="input-map" placeholder="Where are we going?" />
5+
<input type="text" id="input-map" class="form-control" placeholder="Where are we going?" />
66
</div>
77
<div class="right-column">
88
<div id="map"></div>

docs/source/partials/examples/_address_search.html.erb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
<input
2-
type="text"
3-
id="address"
4-
placeholder="Where are we going?"
5-
/>
1+
<input type="text" id="address" class="form-control" placeholder="Where are we going?" />
62

73
<script>
84
var placesAutocomplete = places({

docs/source/partials/examples/_city_search.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<input type="text" id="city" placeholder="In which city do you live?" />
1+
<input type="text" id="city" class="form-control" placeholder="In which city do you live?" />
22

33
<script>
44
var placesAutocomplete = places({

docs/source/partials/examples/_country_search.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<input type="text" id="country" placeholder="What's your favorite country?" />
1+
<input type="text" id="country" class="form-control" placeholder="What's your favorite country?" />
22

33
<script>
44
var placesAutocomplete = places({

docs/source/partials/hero.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
%div.fl-right
1515
= partial("/images/svg/places-illustration.svg")
1616
- if current_page.path == 'index.html'
17-
%input{type: "text", id: "landing-demo", class: "hero-searchbar", autofocus: true, placeholder: "Search a city or address", style: 'opacity: 0'}
17+
%input{type: "text", id: "landing-demo", class: "hero-searchbar form-control", autofocus: true, placeholder: "Search a city or address", style: 'opacity: 0'}

docs/source/partials/navigation.html.haml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
%a{href: "documentation.html", title: "Documentation", :data => {:path => "documentation.html"}} Documentation
1717
%li{nav_active("examples.html")}
1818
%a{href: "examples.html", title: "Examples", :data => {:path => "examples.html"}} Examples
19-
%li{nav_active("nostyle.html")}
20-
%a{href: "nostyle.html", title: "Nostyle test", :data => {:path => "nostyle.html"}} <small>No style test</small>
2119
%li
2220
%a{href: "https://github.com/algolia/places", title: "GitHub repository"}
2321
= partial("/images/svg/icon-github.svg")

0 commit comments

Comments
 (0)