diff options
author | Patrice Chalin <chalin@users.noreply.github.com> | 2022-10-13 23:15:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-13 23:15:01 +0300 |
commit | 19ec7be59a8ac8f959ac3b0688dd9edeb36c8f9a (patch) | |
tree | 1248796afc4805c12bfa042a9c31b2226f8336b2 /layouts | |
parent | ba4ed72caf54c8bbc246e1e5c0553fc897369a8a (diff) |
Search styling refactoring, and fix for offline search (#1279)
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/search-input.html | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/layouts/partials/search-input.html b/layouts/partials/search-input.html index 86eb0c1..feb1e74 100644 --- a/layouts/partials/search-input.html +++ b/layouts/partials/search-input.html @@ -1,7 +1,7 @@ {{ if .Site.Params.gcs_engine_id -}} -<div class="td-search-wrapper"> -<i class="fa fa-search"></i> -<input type="search" class="form-control td-search-input" placeholder="{{ T "ui_search" }}" aria-label="{{ T "ui_search" }}" autocomplete="off"> +<div class="td-search"> + <div class="td-search__icon"></div> + <input type="search" class="td-search__input form-control td-search-input" placeholder="{{ T "ui_search" }}" aria-label="{{ T "ui_search" }}" autocomplete="off"> </div> {{ else if .Site.Params.algolia_docsearch -}} <div id="docsearch"></div> @@ -13,21 +13,24 @@ {{ end -}} {{ $offlineSearchLink := $offlineSearchIndex.RelPermalink -}} -<input - type="search" - class="form-control td-search-input" - placeholder=" {{ T "ui_search" }}" - aria-label="{{ T "ui_search" }}" - autocomplete="off" - {{/* - The data attribute name of the json file URL must end with `src` since - Hugo's absurlreplacer requires `src`, `href`, `action` or `srcset` suffix for the attribute name. - If the absurlreplacer is not applied, the URL will start with `/`. - It causes the json file loading error when when relativeURLs is enabled. - https://github.com/google/docsy/issues/181 - */}} - data-offline-search-index-json-src="{{ $offlineSearchLink }}" - data-offline-search-base-href="/" - data-offline-search-max-results="{{ .Site.Params.offlineSearchMaxResults | default 10 }}" -> +<div class="td-search td-search--offline"> + <div class="td-search__icon"></div> + <input + type="search" + class="td-search__input form-control" + placeholder="{{ T "ui_search" }}" + aria-label="{{ T "ui_search" }}" + autocomplete="off" + {{/* + The data attribute name of the json file URL must end with `src` since + Hugo's absurlreplacer requires `src`, `href`, `action` or `srcset` suffix for the attribute name. + If the absurlreplacer is not applied, the URL will start with `/`. + It causes the json file loading error when when relativeURLs is enabled. + https://github.com/google/docsy/issues/181 + */}} + data-offline-search-index-json-src="{{ $offlineSearchLink }}" + data-offline-search-base-href="/" + data-offline-search-max-results="{{ .Site.Params.offlineSearchMaxResults | default 10 }}" + > +</div> {{ end -}} |