mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 16:29:47 +02:00
fix(theme): avoid rendering empty search container if site has no search plugin (#9385)
This commit is contained in:
parent
77b3b54def
commit
35441b38e4
2 changed files with 15 additions and 3 deletions
|
@ -15,5 +15,9 @@ export default function NavbarSearch({
|
|||
children,
|
||||
className,
|
||||
}: Props): JSX.Element {
|
||||
return <div className={clsx(className, styles.searchBox)}>{children}</div>;
|
||||
return (
|
||||
<div className={clsx(className, styles.navbarSearchContainer)}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -5,15 +5,23 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/*
|
||||
Workaround to avoid rendering empty search container
|
||||
See https://github.com/facebook/docusaurus/pull/9385
|
||||
*/
|
||||
.navbarSearchContainer:not(:has(> *)) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 996px) {
|
||||
.searchBox {
|
||||
.navbarSearchContainer {
|
||||
position: absolute;
|
||||
right: var(--ifm-navbar-padding-horizontal);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 997px) {
|
||||
.searchBox {
|
||||
.navbarSearchContainer {
|
||||
padding: var(--ifm-navbar-item-padding-vertical)
|
||||
var(--ifm-navbar-item-padding-horizontal);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue