File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
packages/docusaurus-theme-classic/src/theme/Navbar/Search Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -15,5 +15,9 @@ export default function NavbarSearch({
15
15
children,
16
16
className,
17
17
} : Props ) : JSX . Element {
18
- return < div className = { clsx ( className , styles . searchBox ) } > { children } </ div > ;
18
+ return (
19
+ < div className = { clsx ( className , styles . navbarSearchContainer ) } >
20
+ { children }
21
+ </ div >
22
+ ) ;
19
23
}
Original file line number Diff line number Diff line change 5
5
* LICENSE file in the root directory of this source tree.
6
6
*/
7
7
8
+ /*
9
+ Workaround to avoid rendering empty search container
10
+ See https://github.com/facebook/docusaurus/pull/9385
11
+ */
12
+ .navbarSearchContainer : not (: has (> * )) {
13
+ display : none;
14
+ }
15
+
8
16
@media (max-width : 996px ) {
9
- .searchBox {
17
+ .navbarSearchContainer {
10
18
position : absolute;
11
19
right : var (--ifm-navbar-padding-horizontal );
12
20
}
13
21
}
14
22
15
23
@media (min-width : 997px ) {
16
- .searchBox {
24
+ .navbarSearchContainer {
17
25
padding : var (--ifm-navbar-item-padding-vertical )
18
26
var (--ifm-navbar-item-padding-horizontal );
19
27
}
You can’t perform that action at this time.
0 commit comments