fix(nx-dev): make toc sticky (#29784)

Makes sidebar table of contents not overlap the footer

Fixes #29719
This commit is contained in:
Isaac Mann 2025-01-28 13:43:19 -05:00 committed by GitHub
parent 5aec542774
commit 67f12a2d7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -115,6 +115,7 @@ export function DocViewer({
</div>
<div className="min-w-0 flex-auto pb-24 lg:pb-16">
{/*MAIN CONTENT*/}
<div className="flex justify-between">
<div className="relative">
<div
ref={ref}
@ -126,10 +127,12 @@ export function DocViewer({
>
{vm.content}
</div>
</div>
{!hideTableOfContent && (
<div>
<div
className={cx(
'fixed right-[max(2rem,calc(50%-55rem))] top-44 z-20 hidden w-60 space-y-6 overflow-y-auto bg-white text-sm xl:block dark:bg-slate-900'
'sticky top-2 z-20 ml-[max(2rem,calc(50%-8rem))] hidden w-60 space-y-6 overflow-y-auto bg-white text-sm xl:block dark:bg-slate-900'
)}
>
{widgetData.githubStarsCount > 0 && (
@ -182,6 +185,7 @@ export function DocViewer({
</>
</TableOfContents>
</div>
</div>
)}
</div>
{/*RELATED CONTENT*/}