diff --git a/.changeset/eleven-pants-work.md b/.changeset/eleven-pants-work.md new file mode 100644 index 0000000000..e9e13d193d --- /dev/null +++ b/.changeset/eleven-pants-work.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Display sidebar on no-TOC pages diff --git a/packages/gitbook/src/components/DocumentView/OpenAPI/style.css b/packages/gitbook/src/components/DocumentView/OpenAPI/style.css index 9ac0b218e3..edaccf8156 100644 --- a/packages/gitbook/src/components/DocumentView/OpenAPI/style.css +++ b/packages/gitbook/src/components/DocumentView/OpenAPI/style.css @@ -122,7 +122,7 @@ } .openapi-column-preview-body { - @apply flex flex-col gap-4 sticky top-4 site-header:top-20 site-header-sections:top-32 page-api-block:xl:max-2xl:top-32 print-mode:static; + @apply flex flex-col gap-4 sticky top-4 site-header:top-20 site-header-sections:page-has-toc:top-32 page-api-block:xl:max-2xl:top-32 print-mode:static; } .openapi-column-preview pre { diff --git a/packages/gitbook/src/components/Header/Dropdown.tsx b/packages/gitbook/src/components/Header/Dropdown.tsx index 67a926163b..e69f093c5f 100644 --- a/packages/gitbook/src/components/Header/Dropdown.tsx +++ b/packages/gitbook/src/components/Header/Dropdown.tsx @@ -38,13 +38,11 @@ export function Dropdown(props: { aria-orientation="vertical" aria-labelledby={dropdownId} className={tcls( - 'w-52', 'max-h-80', 'flex', 'absolute', 'top-full', 'left-0', - 'z-20', 'origin-top-left', 'invisible', 'transition-opacity', @@ -54,22 +52,24 @@ export function Dropdown(props: { className )} > -
- {children} +
+
+ {children} +
diff --git a/packages/gitbook/src/components/Header/Header.tsx b/packages/gitbook/src/components/Header/Header.tsx index 316d769a7f..85d1a965e2 100644 --- a/packages/gitbook/src/components/Header/Header.tsx +++ b/packages/gitbook/src/components/Header/Header.tsx @@ -20,7 +20,6 @@ import { SpacesDropdown } from './SpacesDropdown'; export function Header(props: { context: GitBookSiteContext; withTopHeader?: boolean }) { const { context, withTopHeader } = props; const { siteSpace, siteSpaces, sections, customization } = context; - const isMultiVariants = siteSpaces.length > 1; return (
@@ -86,25 +83,13 @@ export function Header(props: { context: GitBookSiteContext; withTopHeader?: boo 'text-tint-strong', 'theme-bold:text-header-link', 'hover:bg-tint-hover', - 'theme-bold:hover:bg-header-link/3' + 'theme-bold:hover:bg-header-link/3', + 'page-no-toc:hidden' )} />
- {isMultiVariants && ( -
- -
- )} - {customization.header.links.length > 0 && ( {customization.header.links.map((link, index) => { @@ -169,8 +154,48 @@ export function Header(props: { context: GitBookSiteContext; withTopHeader?: boo - {sections ? ( - + + {sections || siteSpaces.length > 1 ? ( +
+
+ {siteSpaces.length > 1 && ( +
+ +
+ )} + {sections && ( + + )} +
+
) : null}
); diff --git a/packages/gitbook/src/components/Header/HeaderLogo.tsx b/packages/gitbook/src/components/Header/HeaderLogo.tsx index 054d1d5a58..925730e3fb 100644 --- a/packages/gitbook/src/components/Header/HeaderLogo.tsx +++ b/packages/gitbook/src/components/Header/HeaderLogo.tsx @@ -55,6 +55,7 @@ export async function HeaderLogo(props: HeaderLogoProps) { 'min-w-0', 'max-w-40', 'lg:max-w-64', + 'site-header-none:page-no-toc:lg:max-w-56', 'max-h-10', 'lg:max-h-12', 'h-full', @@ -84,7 +85,7 @@ function LogoFallback(props: HeaderLogoProps) {
diff --git a/packages/gitbook/src/components/Header/SpacesDropdown.tsx b/packages/gitbook/src/components/Header/SpacesDropdown.tsx index 991fab8f52..23acfe5175 100644 --- a/packages/gitbook/src/components/Header/SpacesDropdown.tsx +++ b/packages/gitbook/src/components/Header/SpacesDropdown.tsx @@ -63,7 +63,7 @@ export function SpacesDropdown(props: { className )} > - {siteSpace.title} + {siteSpace.title}
)} diff --git a/packages/gitbook/src/components/PageAside/PageAside.tsx b/packages/gitbook/src/components/PageAside/PageAside.tsx index f7743dbdc7..3e7d2ebb75 100644 --- a/packages/gitbook/src/components/PageAside/PageAside.tsx +++ b/packages/gitbook/src/components/PageAside/PageAside.tsx @@ -48,8 +48,11 @@ export function PageAside(props: { 'group/aside', 'hidden', 'xl:flex', + // 'page-no-toc:lg:flex', 'flex-col', 'basis-56', + // 'page-no-toc:basis-40', + // 'page-no-toc:xl:basis-56', 'grow-0', 'shrink-0', 'break-anywhere', // To prevent long words in headings from breaking the layout diff --git a/packages/gitbook/src/components/PageBody/PageBody.tsx b/packages/gitbook/src/components/PageBody/PageBody.tsx index e5490090d9..b2965b64d5 100644 --- a/packages/gitbook/src/components/PageBody/PageBody.tsx +++ b/packages/gitbook/src/components/PageBody/PageBody.tsx @@ -47,12 +47,12 @@ export function PageBody(props: { 'page-api-block:xl:max-2xl:pr-0', // Max size to ensure one column in api is aligned with rest of content (2 x 3xl) + (gap-3 + 2) * px-12 'page-api-block:max-w-[1654px]', - 'page-api-block:mx-auto', + 'page-api-block:mx-auto' - page.layout.tableOfContents ? null : 'xl:ml-56' + // page.layout.tableOfContents ? null : 'xl:ml-56' ) + - (asFullWidth ? ' page-full-width' : '') + - (!page.layout.tableOfContents ? ' page-no-toc' : '') + (asFullWidth ? ' page-full-width' : ' page-default-width') + + (!page.layout.tableOfContents ? ' page-no-toc' : ' page-has-toc') } > diff --git a/packages/gitbook/src/components/PageBody/PageCover.tsx b/packages/gitbook/src/components/PageBody/PageCover.tsx index 103daf24b9..2239512f47 100644 --- a/packages/gitbook/src/components/PageBody/PageCover.tsx +++ b/packages/gitbook/src/components/PageBody/PageCover.tsx @@ -32,7 +32,11 @@ export async function PageCover(props: { 'sm:-mx-6', 'md:-mx-8', '-lg:mr-8', - page.layout.tableOfContents ? 'lg:ml-0' : null, + 'lg:ml-0', + !page.layout.tableOfContents && + context.customization.header.preset !== 'none' + ? 'lg:-ml-64' + : null, ] : ['sm:mx-auto', 'max-w-3xl', 'sm:rounded-md', 'mb-8'] )} diff --git a/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx b/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx index 0cf1afea4c..44f165dd16 100644 --- a/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx +++ b/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx @@ -55,7 +55,7 @@ export async function CustomizationRootLayout(props: { lang={customization.internationalization.locale} className={tcls( customization.header.preset === CustomizationHeaderPreset.None - ? null + ? 'site-header-none' : 'scroll-pt-[76px]', // Take the sticky header in consideration for the scrolling customization.styling.corners === CustomizationCorners.Straight ? ' straight-corners' diff --git a/packages/gitbook/src/components/Search/SearchModal.tsx b/packages/gitbook/src/components/Search/SearchModal.tsx index 80956f3e3a..d181393b64 100644 --- a/packages/gitbook/src/components/Search/SearchModal.tsx +++ b/packages/gitbook/src/components/Search/SearchModal.tsx @@ -84,7 +84,7 @@ export function SearchModal(props: SearchModalProps) { 'bg-tint-12/4', 'dark:bg-tint-1/6', 'backdrop-blur-2xl', - 'z-30', + 'z-50', 'px-4', 'pt-4', 'md:pt-[min(8vh,6rem)]' diff --git a/packages/gitbook/src/components/SiteSections/SiteSectionList.tsx b/packages/gitbook/src/components/SiteSections/SiteSectionList.tsx index 88384d4080..226d2dc99c 100644 --- a/packages/gitbook/src/components/SiteSections/SiteSectionList.tsx +++ b/packages/gitbook/src/components/SiteSections/SiteSectionList.tsx @@ -137,12 +137,13 @@ export function SiteSectionGroupItem(props: { return ( <>