mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-22 02:23:30 +00:00
Fix display of cover when TOC is hidden (#328)
* Add visual tests for page options * Fix the case of a landing page * Fix height of the aside when page has a cover * Remove some visual tests
This commit is contained in:
@@ -46,7 +46,8 @@ export async function PageAside(props: {
|
||||
'sticky',
|
||||
'py-8',
|
||||
'break-anywhere', // To prevent long words in headings from breaking the layout
|
||||
withHeaderOffset ? 'lg:h-[calc(100vh_-_4rem)]' : 'lg:h-[100vh]',
|
||||
'lg:h-full',
|
||||
withHeaderOffset ? 'lg:max-h-[calc(100vh_-_4rem)]' : 'lg:max-h-[100vh]',
|
||||
withHeaderOffset ? 'top-16' : 'top-0',
|
||||
'h-[100vh]',
|
||||
|
||||
|
||||
@@ -18,17 +18,22 @@ export async function PageCover(props: {
|
||||
cover: RevisionPageDocumentCover;
|
||||
context: ContentRefContext;
|
||||
}) {
|
||||
const { as, cover, context } = props;
|
||||
const { as, page, cover, context } = props;
|
||||
const resolved = cover.ref ? await resolveContentRef(cover.ref, context) : null;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={tcls(
|
||||
'overflow-hidden',
|
||||
'-mx-4',
|
||||
// Negative margin to balance the container padding
|
||||
'-mx-4',
|
||||
as === 'full'
|
||||
? ['sm:-mx-6', 'md:-mx-8', 'lg:ml-0', '-lg:mr-8']
|
||||
? [
|
||||
'sm:-mx-6',
|
||||
'md:-mx-8',
|
||||
'-lg:mr-8',
|
||||
page.layout.tableOfContents ? 'lg:ml-0' : null,
|
||||
]
|
||||
: ['sm:mx-auto', 'max-w-3xl', 'sm:rounded-md', 'mb-8'],
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user