Fix API reference content squish when AI assistant panel opens#330
Fix API reference content squish when AI assistant panel opens#330patcapulong merged 4 commits intomainfrom
Conversation
The code examples panel (#content-side-layout) had flex-shrink: 0 and min-width: 28rem, making it rigid. When the assistant panel opens, Mintlify moves code content inline but the now-empty panel kept reserving 448px as a ghost element, squishing the main content. Replace with flex: 0 1 28rem so the panel stays at 28rem normally but can collapse when space is constrained. Made-with: Cursor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR fixes a ghost-element layout bug on API reference pages: the code-examples panel ( Confidence Score: 5/5Safe to merge — minimal, targeted CSS change with no logic or data concerns. Single CSS file changed; the fix is correct and precisely scoped. No P0 or P1 findings. The prior P2 comment about max-width redundancy has been noted by the team and is not repeated here. No files require special attention.
|
| Filename | Overview |
|---|---|
| mintlify/style.css | Scopes the flex-shrink: 0 / min-width: 28rem panel rule and the 48px gap rule to html:not([data-assistant-state=open]) so Mintlify's built-in collapse behaviour fires freely when the AI assistant opens. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Page Load / State Change] --> B{data-assistant-state?}
B -- "not 'open'" --> C["html:not([data-assistant-state=open]) rules apply\n• flex-shrink: 0\n• min-width: 28rem\n• gap: 48px"]
C --> D[Two-column layout\ncode panel visible at 28rem]
B -- "open" --> E[Scoped rules do NOT apply\nMintlify built-in collapse fires]
E --> F["Mintlify: html[data-assistant-state=open] ... width:0\nPanel collapses cleanly — no ghost element"]
F --> G[Content area uses full available width]
Reviews (3): Last reviewed commit: "Also scope API reference gap to assistan..." | Re-trigger Greptile
Our min-width: 28rem had higher specificity than Mintlify's built-in html[data-assistant-state=open] collapse rule, creating a ghost element. Wrap with html:not([data-assistant-state=open]) so the rigid sizing only applies when the assistant panel is closed. Made-with: Cursor
The 48px gap between content and code columns persists even when the code panel is collapsed to width:0, since it's still in flex flow. Scope the gap rule with the same html:not([data-assistant-state=open]) so it falls back to the general gap:0 when the assistant is open. Made-with: Cursor
Summary
#content-side-layout) hadflex-shrink: 0andmin-width: 28rem, making it rigidflex: 0 1 28remso the panel renders at 28rem normally but can collapse when the assistant panel reduces available spaceTest plan
Made with Cursor