diff --git a/packages/gitbook/src/components/Header/Header.tsx b/packages/gitbook/src/components/Header/Header.tsx
index 8c8cc8af7..184e88dd5 100644
--- a/packages/gitbook/src/components/Header/Header.tsx
+++ b/packages/gitbook/src/components/Header/Header.tsx
@@ -17,6 +17,8 @@ import { SearchButton } from '../Search';
import { SiteSectionTabs } from '../SiteSections';
import { HeaderMobileMenu } from './HeaderMobileMenu';
+const MAX_HEADER_LINKS_FOR_BIG_SEARCHBAR = 4;
+
/**
* Render the header for the space.
*/
@@ -90,6 +92,10 @@ export function Header(props: {
'flex max-w-full',
isMultiVariants && 'page-no-toc:max-[400px]:w-full',
'shrink min-w-0 gap-2 lg:gap-4 justify-start items-center',
+ customization.header.links.length <=
+ MAX_HEADER_LINKS_FOR_BIG_SEARCHBAR
+ ? 'lg:basis-72'
+ : '',
)}
>
- {isMultiVariants && (
-
-
+ {isMultiVariants && (
+
+
-
- )}
-
- {customization.header.links.length > 0 && (
-
- {customization.header.links.map((link, index) => {
- return (
-
- );
- })}
-
-
- )}
-
+
)}
- >
+
+
+ {customization.header.links.length > 0 && (
+
+ {customization.header.links.map((link, index) => {
+ return (
+
+ );
+ })}
+
+
+ )}
diff --git a/packages/gitbook/src/components/Header/headerLinks.module.css b/packages/gitbook/src/components/Header/headerLinks.module.css
index 010acab70..c2b8d079b 100644
--- a/packages/gitbook/src/components/Header/headerLinks.module.css
+++ b/packages/gitbook/src/components/Header/headerLinks.module.css
@@ -21,7 +21,7 @@
}
}
}
-@container headerlinks ( width < 300px ) {
+@container headerlinks ( width < 250px ) {
.containerHeaderlinks > :nth-child(n + 2) {
display: none;
}
@@ -32,7 +32,7 @@
}
}
}
-@container headerlinks ( width < 450px ) {
+@container headerlinks ( width < 350px ) {
.containerHeaderlinks > :nth-child(n + 3) {
display: none;
}
@@ -43,7 +43,7 @@
}
}
}
-@container headerlinks ( width < 600px ) {
+@container headerlinks ( width < 450px ) {
.containerHeaderlinks > :nth-child(n + 4) {
display: none;
}
@@ -54,7 +54,7 @@
}
}
}
-@container headerlinks ( width < 750px ) {
+@container headerlinks ( width < 550px ) {
.containerHeaderlinks > :nth-child(n + 5) {
display: none;
}
@@ -65,7 +65,7 @@
}
}
}
-@container headerlinks ( width < 850px ) {
+@container headerlinks ( width < 650px ) {
.containerHeaderlinks > :nth-child(n + 6) {
display: none;
}