Skip to content

Commit 06d8cfa

Browse files
author
waleed
committed
added copy page button & fixed TOC alignment
1 parent 381e39f commit 06d8cfa

3 files changed

Lines changed: 25 additions & 10 deletions

File tree

apps/docs/app/global.css

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
/* Shift the sidebar slightly left from the content edge for extra breathing room */
3737
--sidebar-shift: 90px;
3838
--sidebar-offset: max(0px, calc(var(--edge-gutter) - var(--sidebar-shift)));
39-
--toc-offset: var(--edge-gutter);
39+
/* Shift TOC slightly right to match sidebar spacing for symmetry */
40+
--toc-shift: 90px;
41+
--toc-offset: max(0px, calc(var(--edge-gutter) - var(--toc-shift)));
4042
/* Sidebar and TOC have 20px internal padding - navbar accounts for this directly */
4143
/* Extra gap between sidebar/TOC and the main text content */
4244
--content-gap: 1.75rem;
@@ -107,8 +109,21 @@ aside#nd-sidebar {
107109
aside#nd-sidebar {
108110
left: var(--sidebar-offset) !important;
109111
}
110-
[data-toc] {
111-
margin-right: var(--toc-offset) !important;
112+
/* TOC positioning - target all possible selectors */
113+
[data-toc],
114+
aside[data-toc],
115+
div[data-toc],
116+
.fd-toc,
117+
#nd-toc,
118+
nav[data-toc],
119+
aside:has([role="complementary"]) {
120+
right: var(--toc-offset) !important;
121+
}
122+
123+
/* Alternative TOC container targeting */
124+
[data-docs-page] > aside:last-child,
125+
main ~ aside {
126+
right: var(--toc-offset) !important;
112127
}
113128
}
114129

apps/docs/components/navbar/navbar.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ export function Navbar() {
1919
{/* Desktop: Single row layout */}
2020
<div className='hidden h-16 w-full items-center lg:flex'>
2121
<div
22-
className='grid w-full grid-cols-[auto_1fr_auto] items-center'
22+
className='relative flex w-full items-center justify-between'
2323
style={{
2424
paddingLeft: 'calc(var(--sidebar-offset) + 20px)',
25-
paddingRight: 'calc(var(--toc-offset) + 20px)',
25+
paddingRight: 'calc(var(--toc-offset) + 60px)',
2626
}}
2727
>
28-
{/* Left cluster: translate by sidebar delta to align with sidebar edge */}
28+
{/* Left cluster: logo */}
2929
<div className='flex items-center'>
3030
<Link href='/' className='flex min-w-[100px] items-center'>
3131
<Image
@@ -38,12 +38,12 @@ export function Navbar() {
3838
</Link>
3939
</div>
4040

41-
{/* Center cluster: search */}
42-
<div className='flex flex-1 items-center justify-center pl-32'>
41+
{/* Center cluster: search - absolutely positioned to center */}
42+
<div className='-translate-x-1/2 absolute left-1/2 flex items-center justify-center'>
4343
<SearchTrigger />
4444
</div>
4545

46-
{/* Right cluster aligns with TOC edge using the same right gutter */}
46+
{/* Right cluster aligns with TOC edge */}
4747
<div className='flex items-center gap-4'>
4848
<Link
4949
href='https://sim.ai'

apps/docs/components/ui/copy-page-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function CopyPageButton({ content }: CopyPageButtonProps) {
2323
return (
2424
<button
2525
onClick={handleCopy}
26-
className='flex items-center gap-1.5 rounded-lg border border-border/40 bg-background px-2.5 py-1.5 text-muted-foreground/60 text-sm shadow-sm transition-all hover:border-border hover:bg-accent/50 hover:text-muted-foreground'
26+
className='flex items-center gap-1.5 rounded-lg border border-border/40 bg-background px-2.5 py-1.5 text-muted-foreground/60 text-sm transition-all hover:border-border hover:bg-accent/50 hover:text-muted-foreground'
2727
aria-label={copied ? 'Copied to clipboard' : 'Copy page content'}
2828
>
2929
{copied ? (

0 commit comments

Comments
 (0)