Skip to content

Commit d2c6f48

Browse files
committed
add search icon on sidebar and search-page
1 parent 48c0102 commit d2c6f48

File tree

5 files changed

+33
-8
lines changed

5 files changed

+33
-8
lines changed

docs/_static/custom.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,20 @@ div.admonition.admonition-todo>.admonition-title::before {
189189
padding-bottom: 0;
190190
}
191191

192+
#search-form .search-icon {
193+
position: absolute;
194+
top: 50%;
195+
transform: translate(0,-50%);
196+
color: #a4a6a7;
197+
left: 6.875rem;
198+
z-index: 100;
199+
}
200+
201+
#search-form .form-control {
202+
border-radius: .2rem;
203+
padding-left: 2.1875rem;
204+
}
205+
192206
.form-control:focus {
193207
box-shadow: none;
194208
border-width: 2px;
@@ -248,6 +262,7 @@ ul.search li p.context {
248262

249263
.bd-search .input-group {
250264
flex-direction: row-reverse;
265+
align-items: center;
251266
}
252267

253268
.bd-search {
@@ -260,6 +275,21 @@ ul.search li p.context {
260275
padding-left: .5em;
261276
}
262277

278+
.bd-search .input-group-append {
279+
align-self: stretch;
280+
}
281+
282+
.bd-search input {
283+
padding-left: 2.1875rem;
284+
}
285+
286+
.bd-search .search-icon {
287+
position: absolute;
288+
color: #a4a6a7;
289+
left: .625rem;
290+
z-index: 100;
291+
}
292+
263293
.input-group-text kbd {
264294
padding: 0rem 0.4rem;
265295
font-size: 135%;

docs/_static/search_shortcut.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
}
1414
});
1515

16-
// $("button[type='reset']").on('click',function () {
17-
// const formInputs = $('#search-form').find('.form-check-input');
18-
// if(formInputs.length) {
19-
// formInputs.prop('checked',false);
20-
// formInputs.find('#doc_section_all').prop('checked',true);
21-
// }
22-
// });
2316
} else {
2417
$(document).keydown(function(event) {
2518
if ((event.ctrlKey || event.metaKey) && event.key == "k") {

docs/_templates/search-field.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<kbd id="search-shortcut"></kbd>&nbsp;<kbd>K</kbd>
88
</span>
99
</div>
10+
<i class="search-icon fa fa-search fa-lg" aria-hidden="true"></i>
1011
<input
1112
type="search" name="q" id="search-input"
1213
class="form-control"

docs/_templates/search.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ <h1 id="search-documentation">{{ _('Search') }}</h1>
5555
<kbd id="search-shortcut"></kbd>&nbsp;<kbd>K</kbd>
5656
</span>
5757
</div>
58+
<i class="search-icon fa fa-search fa-lg" aria-hidden="true"></i>
5859
<input
5960
type="search" name="q" id="q"
6061
class="form-control"

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223
html_logo = "_static/logo.svg"
224224
html_favicon = "_static/favicon.ico"
225225

226-
html_css_files = ["custom.css", ("print.css", {"media": "print"})]
226+
html_css_files = ["custom.css", ("print.css", {"media": "print"}),"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"]
227227

228228
# See http://sphinx-doc.org/ext/todo.html#confval-todo_include_todos
229229
todo_include_todos = True

0 commit comments

Comments
 (0)