Skip to content

Commit dedbe4f

Browse files
mkruskal-googlechalin
authored andcommitted
Fixing magnifying glass icon handling in search bar
1 parent 326b0f1 commit dedbe4f

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

assets/scss/_search.scss

+26-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
// Search
2-
3-
.td-search-input {
2+
.td-search-wrapper {
3+
position: relative;
44
background: transparent;
55
max-width: 90%;
6+
}
7+
8+
.td-search-wrapper .td-search-input {
9+
width: 100%;
10+
text-indent: 1.25em;
611

712
&.form-control:focus {
813
border-color: lighten($primary, 60%);
@@ -14,7 +19,25 @@
1419
border-radius: 1rem;
1520
}
1621

17-
font-family: $font-family-base, $font-awesome-font-name;
22+
font-family: $font-family-base;
23+
}
24+
25+
.td-search-wrapper .fa {
26+
// Make this consistent with placeholder formatting.
27+
color: $input-placeholder-color;
28+
29+
// Vertically center the content.
30+
display: flex;
31+
justify-content: center;
32+
align-items:center;
33+
height: 100%;
34+
35+
// Position this on the left of the input.
36+
position: absolute;
37+
left: 0.75em;
38+
39+
// Click-through to the underlying input.
40+
pointer-events: none;
1841
}
1942

2043
.popover.offline-search-result {

layouts/partials/search-input.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{{ if .Site.Params.gcs_engine_id -}}
2-
<input type="search" class="form-control td-search-input" placeholder="&#xf002; {{ T "ui_search" }}" aria-label="{{ T "ui_search" }}" autocomplete="off">
2+
<div class="td-search-wrapper">
3+
<i class="fa fa-search"></i>
4+
<input type="search" class="form-control td-search-input" placeholder="{{ T "ui_search" }}" aria-label="{{ T "ui_search" }}" autocomplete="off">
5+
</div>
36
{{ else if .Site.Params.algolia_docsearch -}}
47
<div id="docsearch"></div>
58
{{ else if .Site.Params.offlineSearch -}}

0 commit comments

Comments
 (0)