@@ -70,14 +70,15 @@ export function DocPage({
7070 < main className = "main-content flex w-full mt-[var(--header-height)] flex-1 mx-auto" >
7171 < div
7272 className = { [
73- 'mx-auto lg:mx-0 pt-6 px-6 prose dark:prose-invert max-w-full text-[var(--gray-12)] prose-a:no-underline hover:prose-a:underline' ,
73+ 'mx-auto pt-6 px-6 prose dark:prose-invert max-w-full text-[var(--gray-12)] prose-a:no-underline hover:prose-a:underline' ,
7474 'prose-code:font-normal prose-code:font-mono marker:text-[var(--accent)] prose-li:my-1' ,
7575 'prose-headings:mt-0 prose-headings:font-medium prose-headings:relative prose-headings:text-[var(--gray-12)]' ,
7676 'prose-blockquote:font-normal prose-blockquote:border-l-[3px] prose-em:font-normal prose-blockquote:text-[var(--gray-12)]' ,
7777 'prose-img:my-2' ,
7878 'prose-strong:text-[var(--gray-12)]' ,
79- fullWidth ? 'max-w-none w-full' : 'w-[75ch] xl:max-w-[calc(100%-250px)] ' ,
79+ fullWidth ? 'max-w-none w-full' : 'w-full ' ,
8080 ] . join ( ' ' ) }
81+ id = "doc-content"
8182 >
8283 < div className = "mb-4" >
8384 < Banner />
@@ -113,16 +114,50 @@ export function DocPage({
113114 </ div >
114115 </ div >
115116
116- { hasToc && (
117- < aside className = "sticky h-[calc(100vh-var(--header-height))] top-[var(--header-height)] overflow-y-auto hidden xl:block w-[250px]" >
118- < div className = "sidebar" >
119- < SidebarTableOfContents />
120- < PlatformSdkDetail />
121- </ div >
122- </ aside >
123- ) }
124117 </ main >
118+ { hasToc && (
119+ < aside
120+ data-layout-anchor = "right"
121+ className = "sticky h-[calc(100vh-var(--header-height))] top-[var(--header-height)] overflow-y-auto hidden xl:block w-[250px]"
122+ >
123+ < div className = "sidebar" >
124+ < SidebarTableOfContents />
125+ < PlatformSdkDetail />
126+ </ div >
127+ </ aside >
128+ ) }
125129 </ section >
130+ < style > { `:root { --doc-content-w: 100ch; } #doc-content { max-width: var(--doc-content-w); }` } </ style >
131+ < style > { `
132+ @media (min-width: 2057px) {
133+ :root {
134+ --doc-content-w: 100ch;
135+ --toc-w: 250px;
136+ --gap: 24px;
137+ }
138+ /* Cap content width and center (reinforced at this breakpoint) */
139+ #doc-content {
140+ max-width: var(--doc-content-w);
141+ padding-left: 5rem; /* increase from px-6 (24px) to 5rem (80px) */
142+ padding-right: 5rem;
143+ }
144+ /* Cancel default push so content can center */
145+ [data-layout-anchor="left"] + .main-content {
146+ margin-left: 0 !important;
147+ width: 100% !important;
148+ }
149+ /* Anchor sidebars to content edges */
150+ [data-layout-anchor="left"] {
151+ left: calc(50% - (var(--doc-content-w) / 2) - var(--gap) - var(--sidebar-width));
152+ }
153+ [data-layout-anchor="right"] {
154+ position: fixed !important;
155+ left: calc(50% + (var(--doc-content-w) / 2) + var(--gap));
156+ width: var(--toc-w);
157+ }
158+ }
159+ ` } </ style >
160+
126161 < Mermaid />
127162 < ReaderDepthTracker />
128163 </ div >
0 commit comments