-
Notifications
You must be signed in to change notification settings - Fork 0
docs: make desktop sidebar width a true max #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,8 +47,19 @@ html > body[data-scroll-locked] { | |
|
|
||
| @media (min-width: 768px) { | ||
| #nd-docs-layout { | ||
| /* Fumadocs switches from drawer to full sidebar at 768px; prefer the normal 270px width and only shrink slightly on the narrowest desktop viewports. */ | ||
| --fd-sidebar-width: min(270px, 35vw); | ||
| /* Fumadocs sets the sidebar track inline; override it so desktop can shrink to content up to 270px instead of reserving a fixed column. */ | ||
| --fd-sidebar-col: fit-content(270px) !important; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
At desktop widths ( Useful? React with 👍 / 👎. |
||
| --fd-sidebar-width: 270px; | ||
| } | ||
|
|
||
| #nd-docs-layout [data-sidebar-placeholder] { | ||
| --fd-sidebar-width: fit-content(270px); | ||
| max-inline-size: 270px; | ||
| } | ||
|
|
||
| #nd-docs-layout #nd-sidebar { | ||
| inline-size: fit-content(270px); | ||
| max-inline-size: 270px; | ||
| } | ||
|
|
||
| /* Fumadocs still mounts the collapsed-panel shell on desktop; keep it hidden. */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning: Grid track and sidebar
inline-sizecan diverge, preventing content area from reclaiming spaceThe grid track
--fd-sidebar-colis set tofit-content(270px), which means the column will shrink to the sidebar's actual rendered width. However,#nd-sidebarhasinline-size: fit-content(270px)applied directly as an element style, which is resolved independently by the browser — the grid item's contribution to the track size is its min/max content size, not the track definition itself.If Fumadocs sizes
#nd-sidebarwith its own internal styles (e.g., via a CSS variable), the track may not shrink as expected. The column track shrinks based on the grid item's content size, but if the item has an explicitinline-sizeapplied, it may prevent the grid from reclaiming space correctly. Additionally,--fd-sidebar-width: 270px(a fixed value) is still set on#nd-docs-layout, so any Fumadocs internals that read this variable will see a fixed 270px, not the actual rendered width. Consider setting--fd-sidebar-widthtofit-content(270px)here as well, matching the placeholder override.