-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(developer docs): Correcting width issues in developer docs for toc #15559
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 1 commit
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 |
|---|---|---|
|
|
@@ -134,6 +134,14 @@ export function DocPage({ | |
| max-width: none; | ||
| box-sizing: border-box; | ||
| } | ||
| /* At toc breakpoint (1490px), constrain content to leave room for TOC */ | ||
| @media (min-width: 1490px) { | ||
| #doc-content { | ||
| /* Calculate max width: viewport - sidebar - TOC - gaps - padding */ | ||
| /* Leave room for: sidebar (300px) + TOC (250px) + gaps (48px) + padding (96px) */ | ||
| max-width: calc(100vw - 300px - 250px - 48px - 96px); | ||
| } | ||
| } | ||
|
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. Bug: Undefined CSS variable breaks sidebar positioningThe CSS at the 2057px breakpoint references 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. Bug: Incorrect padding value in width calculationThe media query calculation assumes 96px of horizontal padding, but the |
||
| @media (min-width: 2057px) { | ||
| :root { | ||
| --doc-content-w: 1100px; | ||
|
|
||
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.
Bug:
max-widthcalculation using100vwincludes scrollbar width, causing#doc-contentto be too wide and potentially leading to horizontal overflow.Severity: HIGH | Confidence: High
🔍 Detailed Analysis
The
max-widthcalculation for#doc-contentuses100vw, which includes the width of the vertical scrollbar. When a vertical scrollbar is present, this causes the element to be approximately 15px wider than intended, leading to potential horizontal overflow, misalignment of layout elements like the TOC, and possible appearance of a horizontal scrollbar at the1490pxbreakpoint.💡 Suggested Fix
Avoid
100vwfor width calculations when scrollbars are a concern. Consider using100%relative to the parent container,min(100vw - scrollbar_width, ...)if supported, or calculating the available width with JavaScript.🤖 Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.
Reference_id: 2811448