Skip to content

Commit 4e44433

Browse files
authored
Fix API reference content squish when AI assistant panel opens (#330)
## Summary - On API reference pages, the code examples panel (`#content-side-layout`) had `flex-shrink: 0` and `min-width: 28rem`, making it rigid - When the AI assistant chat panel opens, Mintlify moves code content inline into the main content area, but the now-empty panel kept reserving 448px + 48px gap as a ghost element, squishing the visible content - Replace with `flex: 0 1 28rem` so the panel renders at 28rem normally but can collapse when the assistant panel reduces available space ## Test plan - [x] Open an API reference page on staging (e.g., Get customer by ID) - [x] Verify the two-column layout (content left, code examples right) looks the same as prod - [x] Open the AI assistant panel and verify the content is no longer squished / ghost element collapses - [x] Close the assistant and verify layout returns to normal - [x] Spot-check a non-API page (e.g., Core Concepts) to confirm the TOC sidebar is unaffected Made with [Cursor](https://cursor.com)
1 parent 8a4e47a commit 4e44433

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

mintlify/style.css

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,8 +1513,10 @@ html.dark div[class*="lg:flex-1"][class*="overflow-x-clip"] {
15131513
max-width: 100% !important;
15141514
}
15151515

1516-
/* Ensure code panel doesn't shrink on API reference pages */
1517-
#content-container:has(#api-playground-2-operation-page) #content-side-layout {
1516+
/* Ensure code panel doesn't shrink on API reference pages.
1517+
Scoped to assistant-closed so Mintlify's built-in collapse rule
1518+
(html[data-assistant-state=open] ... { width:0 }) isn't overridden. */
1519+
html:not([data-assistant-state=open]) #content-container:has(#api-playground-2-operation-page) #content-side-layout {
15181520
flex-shrink: 0 !important;
15191521
min-width: 28rem !important;
15201522
}
@@ -1525,9 +1527,9 @@ html.dark div[class*="lg:flex-1"][class*="overflow-x-clip"] {
15251527
min-width: 0 !important;
15261528
}
15271529

1528-
/* Add gap between main content and code column ONLY on API reference pages */
1529-
/* Uses :has() to scope the rule to pages containing the API playground */
1530-
#content-container > div[class*="flex-row-reverse"]:has(#api-playground-2-operation-page) {
1530+
/* Add gap between main content and code column ONLY on API reference pages.
1531+
Scoped to assistant-closed so the gap collapses with the code panel. */
1532+
html:not([data-assistant-state=open]) #content-container > div[class*="flex-row-reverse"]:has(#api-playground-2-operation-page) {
15311533
gap: 48px !important;
15321534
}
15331535

0 commit comments

Comments
 (0)