Skip to content

Commit 900bfd1

Browse files
fix: fix theme button overlap and keep "What is Kubestellar?" dropdown open (#319)
* fix : Enhance sidebar behavior Signed-off-by: Khushi Agrawal <[email protected]> * fix : Enhance sidebar behavior Signed-off-by: Khushi Agrawal <[email protected]> * refactor: Simplify CSS calculations for sticky sidebar positioning --------- Signed-off-by: Khushi Agrawal <[email protected]>
1 parent 5058c26 commit 900bfd1

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

src/app/docs/page-map.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function buildPageMapForBranch(branch: string) {
5656

5757
// Strong types for page-map nodes (no `any`)
5858
type MdxPageNode = { kind: 'MdxPage'; name: string; route: string }
59-
type FolderNode = { kind: 'Folder'; name: string; route: string; children: PageMapNode[] }
59+
type FolderNode = { kind: 'Folder'; name: string; route: string; children: PageMapNode[]; theme?: { collapsed?: boolean } }
6060
type MetaNode = { kind: 'Meta'; data: Record<string, string> }
6161
type PageMapNode = MdxPageNode | FolderNode | MetaNode
6262

@@ -238,7 +238,18 @@ export async function buildPageMapForBranch(branch: string) {
238238

239239
if (!children.length) continue
240240

241-
_pageMap.push({ kind: 'Folder', name: categoryName, route: `/${basePath}/${categorySlug}`, children })
241+
const folderNode: FolderNode & { theme?: { collapsed?: boolean } } = {
242+
kind: 'Folder',
243+
name: categoryName,
244+
route: `/${basePath}/${categorySlug}`,
245+
children
246+
}
247+
248+
if (categoryName.toLowerCase().startsWith('what is kubestellar')) {
249+
folderNode.theme = { collapsed: false }
250+
}
251+
252+
_pageMap.push(folderNode)
242253
}
243254

244255
const remainingFiles = allDocFiles.filter(fp => {

src/app/globals.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ html:not(.dark) .nextra-docs-theme .nextra-sidebar-container {
8181
height: 100%;
8282
}
8383

84+
/* Ensure sticky sidebar offsets respect banner height */
85+
.nextra-sidebar {
86+
top: calc(
87+
var(--nextra-navbar-height, 4rem) + var(--nextra-banner-height, 0px)
88+
) !important;
89+
height: calc(
90+
100dvh - var(--nextra-navbar-height, 4rem) -
91+
var(--nextra-banner-height, 0px)
92+
) !important;
93+
}
94+
8495
/* Make the navigation list scrollable with proper padding at bottom */
8596
.nextra-sidebar-container nav {
8697
flex: 1;

0 commit comments

Comments
 (0)