diff --git a/apps/www/src/app/docs/[[...slug]]/page.module.css b/apps/www/src/app/docs/[[...slug]]/page.module.css index 3a724d3dd..91e429e40 100644 --- a/apps/www/src/app/docs/[[...slug]]/page.module.css +++ b/apps/www/src/app/docs/[[...slug]]/page.module.css @@ -38,3 +38,26 @@ letter-spacing: var(--docs-lede-tracking); max-width: 42rem; } + +/* + The rail sits beside the article and stays put while it scrolls. Its width + matches the sidebar's, so the article sits in the middle of equal gutters, + and it is fixed so the text keeps the same measure on every page regardless + of how many headings that page has. +*/ +.toc { + flex-shrink: 0; + display: flex; + flex-direction: column; + width: 240px; + height: calc(100vh - 50px); + position: sticky; + top: 50px; + /* + The rail's inner edge, matching the one on the sidebar. It starts below the + navbar rather than at the top of the screen, because above that line the + navbar is one strip running the width of the article — there is nothing + there for the rule to divide. + */ + border-left: 0.5px solid var(--rs-color-border-base-primary); +} diff --git a/apps/www/src/app/docs/[[...slug]]/page.tsx b/apps/www/src/app/docs/[[...slug]]/page.tsx index 0b70d3356..b49a82823 100644 --- a/apps/www/src/app/docs/[[...slug]]/page.tsx +++ b/apps/www/src/app/docs/[[...slug]]/page.tsx @@ -64,28 +64,8 @@ export default async function Page(props: PageProps<'/docs/[[...slug]]'>) { -