From a65654edfbb8cf8847e4c2f162f8109bb91022af Mon Sep 17 00:00:00 2001 From: Zeno Kapitein Date: Wed, 22 Jan 2025 14:41:45 +0100 Subject: [PATCH] Balance links with search bar and variant dropdown --- .../gitbook/src/components/Header/Header.tsx | 55 ++++++++++--------- .../src/components/Header/HeaderLinks.tsx | 2 +- .../src/components/Header/HeaderLogo.tsx | 2 +- .../src/components/Header/SpacesDropdown.tsx | 2 +- .../components/Header/headerLinks.module.css | 22 ++++---- 5 files changed, 44 insertions(+), 39 deletions(-) diff --git a/packages/gitbook/src/components/Header/Header.tsx b/packages/gitbook/src/components/Header/Header.tsx index 9ee35ba0b6..b7ce6dbc9e 100644 --- a/packages/gitbook/src/components/Header/Header.tsx +++ b/packages/gitbook/src/components/Header/Header.tsx @@ -98,6 +98,7 @@ export function Header(props: { MAX_HEADER_LINKS_FOR_BIG_SEARCHBAR ? 'lg:basis-72' : '', + isMultiVariants && 'page-no-toc:lg:basis-auto', )} > + {isMultiVariants && ( +
+ +
+ )} +
- {isMultiVariants && ( -
- -
- )} - .button+.button]:-ml-2', + 'grow-[2.5] shrink flex justify-end items-center gap-x-4 lg:gap-x-6 min-w-9 z-20 lg:[&>.button+.button]:-ml-2', )} > {children} diff --git a/packages/gitbook/src/components/Header/HeaderLogo.tsx b/packages/gitbook/src/components/Header/HeaderLogo.tsx index 18c1201eef..65addec76e 100644 --- a/packages/gitbook/src/components/Header/HeaderLogo.tsx +++ b/packages/gitbook/src/components/Header/HeaderLogo.tsx @@ -95,7 +95,7 @@ function LogoFallback(props: HeaderLogoProps) {
- {space.title} + {space.title}
)} diff --git a/packages/gitbook/src/components/Header/headerLinks.module.css b/packages/gitbook/src/components/Header/headerLinks.module.css index 38a5ec0f77..50e9fc76cc 100644 --- a/packages/gitbook/src/components/Header/headerLinks.module.css +++ b/packages/gitbook/src/components/Header/headerLinks.module.css @@ -7,11 +7,13 @@ } } -@media(max-width:1023px) { - .containerHeaderlinks { - container-type: inline-size; - container-name: headerlinks; - } +.containerHeaderlinks { + container-type: inline-size; + container-name: headerlinks; +} + +/* @media(max-width:1279px) { + } @media(max-width:1279px) { @@ -36,7 +38,7 @@ display: flex; } } -} +} */ /* @media (max-width: 1024px) { .containerHeaderlinks > :nth-child(n + 4) { @@ -96,7 +98,7 @@ } } } -@container headerlinks ( width < 400px ) { +@container headerlinks ( width < 450px ) { .containerHeaderlinks > :nth-child(n + 3) { display: none; } @@ -107,7 +109,7 @@ } } } -@container headerlinks ( width < 500px ) { +@container headerlinks ( width < 550px ) { .containerHeaderlinks > :nth-child(n + 4) { display: none; } @@ -118,7 +120,7 @@ } } } -@container headerlinks ( width < 600px ) { +@container headerlinks ( width < 650px ) { .containerHeaderlinks > :nth-child(n + 5) { display: none; } @@ -129,7 +131,7 @@ } } } -@container headerlinks ( width < 700px ) { +@container headerlinks ( width < 750px ) { .containerHeaderlinks > :nth-child(n + 6) { display: none; }