Docs: improved sidebar size and scrolling when has a large number of items
This commit is contained in:
@@ -53,7 +53,7 @@ export function DocsNavigation({ pages }: { pages: Cms.ContentItem[] }) {
|
|||||||
<>
|
<>
|
||||||
<Sidebar
|
<Sidebar
|
||||||
variant={'ghost'}
|
variant={'ghost'}
|
||||||
className={'sticky'}
|
className={'sticky z-1 max-h-full overflow-y-auto'}
|
||||||
>
|
>
|
||||||
<Tree pages={pages} level={0} />
|
<Tree pages={pages} level={0} />
|
||||||
</Sidebar>
|
</Sidebar>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export function DocsTableOfContents(props: { data: NavItem[] }) {
|
|||||||
const navData = props.data;
|
const navData = props.data;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="lg:block hidden sticky z-10 bg-background min-w-[14em] border-l p-4 inset-y-0 h-svh">
|
<div className="lg:block hidden sticky bg-background min-w-[14em] border-l p-4 inset-y-0 h-svh max-h-full">
|
||||||
<ol
|
<ol
|
||||||
role="list"
|
role="list"
|
||||||
className="relative text-sm text-gray-600 dark:text-gray-400"
|
className="relative text-sm text-gray-600 dark:text-gray-400"
|
||||||
|
|||||||
@@ -13,7 +13,10 @@ async function DocsLayout({ children }: React.PropsWithChildren) {
|
|||||||
const tree = buildDocumentationTree(docs);
|
const tree = buildDocumentationTree(docs);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidebarProvider className={'lg:container'}>
|
<SidebarProvider
|
||||||
|
style={{ '--sidebar-width': '20em' } as React.CSSProperties}
|
||||||
|
className={'lg:container'}
|
||||||
|
>
|
||||||
<DocsNavigation pages={tree} />
|
<DocsNavigation pages={tree} />
|
||||||
|
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
Reference in New Issue
Block a user