diff --git a/packages/gitbook/src/components/DocumentView/OpenAPI/style.css b/packages/gitbook/src/components/DocumentView/OpenAPI/style.css index ee840de73..81b4e3247 100644 --- a/packages/gitbook/src/components/DocumentView/OpenAPI/style.css +++ b/packages/gitbook/src/components/DocumentView/OpenAPI/style.css @@ -149,7 +149,9 @@ } .openapi-column-preview { - @apply flex flex-col flex-1 xl:max-2xl:pt-20 lg:pt-6 sticky self-start max-h-[calc(100vh-var(--toc-top-offset))] top-(--toc-top-offset); + /* Shift down by ~2rem so the pinned preview clears the sticky "On this page" / + page-actions bar below the header, and leave a 1rem gap at the bottom of the viewport. */ + @apply flex flex-col flex-1 xl:max-2xl:pt-8 lg:pt-6 sticky self-start max-h-[calc(100vh-var(--toc-top-offset)-3rem)] top-[calc(var(--toc-top-offset)+2rem)]; } .openapi-column-preview-body { diff --git a/packages/gitbook/src/components/PageBody/PageHeader.tsx b/packages/gitbook/src/components/PageBody/PageHeader.tsx index d118de9ae..a71085849 100644 --- a/packages/gitbook/src/components/PageBody/PageHeader.tsx +++ b/packages/gitbook/src/components/PageBody/PageHeader.tsx @@ -47,11 +47,34 @@ export async function PageHeader(props: { } return ( -
+ <> + {/* Page actions (assistant, "On this page", ...). Rendered as a sibling of the +
— i.e. a direct child of the scrolling
— so that on larger screens + it can stick to the top of the viewport while the page is scrolled. If it lived + inside the
, its sticky containing block would be the short header and it + would scroll away with it. */}
{hasPageActions ? ( @@ -70,78 +93,87 @@ export async function PageHeader(props: {
- {hasAncestors && ( -
+ + ); + })} + + + )} + + {page.layout.title ? ( +

+ + {page.title} +

+ ) : null} + {page.description && page.layout.description ? ( +

+ {page.description} +

+ ) : null} +
+ ); } diff --git a/packages/gitbook/src/components/primitives/Button.tsx b/packages/gitbook/src/components/primitives/Button.tsx index ebe422e30..14a31dbbc 100644 --- a/packages/gitbook/src/components/primitives/Button.tsx +++ b/packages/gitbook/src/components/primitives/Button.tsx @@ -58,10 +58,8 @@ export const variantClasses = { ], secondary: [ 'bg-tint', - 'depth-flat:bg-transparent', 'text-tint', 'hover:bg-tint-hover', - 'hover:not-disabled:depth-flat:bg-tint-hover', 'hover:not-disabled:text-tint', 'contrast-more:bg-tint-subtle', 'disabled:bg-transparent',