[FIX] theme: improve search bar implementation and behavior
This commit removes the extra search bar that was dedicated to the mobile layout and adapts the desktop's one to be compatible with mobile. It also brings back the "Hide Search Matches" button.
This commit is contained in:
parent
0fcc06c2db
commit
26d489c6e1
@ -91,10 +91,6 @@
|
|||||||
{%- set main_classes = main_classes + ['o_fullwidth_page'] %}
|
{%- set main_classes = main_classes + ['o_fullwidth_page'] %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
<div class="px-3 py-4 d-lg-none">
|
|
||||||
<!-- Searchbox only visible in mobile -->
|
|
||||||
{%- include "layout_templates/searchbox.html" %}
|
|
||||||
</div>
|
|
||||||
<main class="container-fluid {{ ' '.join(main_classes) }}">
|
<main class="container-fluid {{ ' '.join(main_classes) }}">
|
||||||
{%- if pagename == master_doc %}
|
{%- if pagename == master_doc %}
|
||||||
{# Custom landing page on the root of the documentation #}
|
{# Custom landing page on the root of the documentation #}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{# NOTE: the 'searchbox' id is used to hook the "Hide Search Matches" button #}
|
{# NOTE: the 'searchbox' id is used to hook the "Hide Search Matches" button #}
|
||||||
{# NOTE: currently renamed to '_searchbox' to hide the button until it receives proper styling #}
|
<div id="searchbox" class="o_search_wrapper flex-grow-1 pe-lg-2" role="search">
|
||||||
<div id="_searchbox" class="o_search_wrapper flex-grow-1 justify-content-stretch justify-content-lg-start pe-lg-2" role="search">
|
|
||||||
<form class="o_search" action="{{ pathto('search') }}" method="get">
|
<form class="o_search" action="{{ pathto('search') }}" method="get">
|
||||||
<input type="text" name="q" id="q" class="form-control rounded-pill" placeholder="What are you looking for?">
|
<input type="text" name="q" id="q" class="form-control rounded-pill" placeholder="What are you looking for?">
|
||||||
<input type="hidden" name="area" value="default">
|
<input type="hidden" name="area" value="default">
|
||||||
|
@ -72,17 +72,22 @@ header.o_main_header{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.o_search_wrapper {
|
.o_search_wrapper {
|
||||||
|
display: flex;
|
||||||
@include media-breakpoint-down(lg) {
|
@include media-breakpoint-down(lg) {
|
||||||
display: none !important;
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 10px;
|
||||||
|
top: calc(100% + 30px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.highlight-link {
|
.highlight-link {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
display: flex;
|
padding: 0 1rem;
|
||||||
align-items: center;
|
text-align: center;
|
||||||
|
align-self: center;
|
||||||
a {
|
a {
|
||||||
padding: 0 1rem;
|
|
||||||
@include font-size($font-size-secondary);
|
@include font-size($font-size-secondary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -369,6 +374,9 @@ header.o_main_header{
|
|||||||
main {
|
main {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-top: 3rem;
|
padding-top: 3rem;
|
||||||
|
@include media-breakpoint-down(lg) {
|
||||||
|
padding-top: 7rem;
|
||||||
|
}
|
||||||
padding-bottom: 3rem;
|
padding-bottom: 3rem;
|
||||||
|
|
||||||
@include media-breakpoint-up(lg) {
|
@include media-breakpoint-up(lg) {
|
||||||
|
Loading…
Reference in New Issue
Block a user