Docs: fix the footer collapse button on production (new Mintlify theme-switcher markup)#672
Conversation
…tions Mintlify's evergreen hosted renderer replaced the single "Toggle dark mode" button with a "Theme preference" three-option group, so every selector and the JS insertion point matched nothing on production — the button silently vanished there while the pinned local CLI (4.2.284) still rendered the old markup it was built against. All anchors now target both shapes, and the positioning context is declared by our rules instead of inherited from Mintlify's utility classes. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Greptile SummaryThis PR fixes the sidebar footer collapse button that silently disappeared on production because Mintlify's hosted (evergreen) renderer replaced the single
Confidence Score: 5/5Safe to merge — the changes are narrowly scoped to CSS selectors and a single JS querySelector, with no logic changes to toggle behavior, persistence, or SPA re-sync. Both files make purely additive changes: every existing selector gains a comma-paired variant for the new Mintlify markup, and position: relative is promoted from an inherited Mintlify class to an explicit rule. The toggle logic, drag-to-resize, localStorage persistence, and MutationObserver are all untouched. The fix covers all dark-mode, hover, and dark-hover variants of the pseudo-elements. No files require special attention.
|
| Filename | Overview |
|---|---|
| mintlify/sidebar-toggle.js | querySelector updated with comma-separated selector covering both the old button[aria-label="Toggle dark mode"] and new [role="group"][aria-label="Theme preference"]; insertion logic (insertBefore(footerBtn, theme.nextSibling)) is unchanged and works for both element types. |
| mintlify/style.css | All seven CSS rule blocks (slot reservation, ::after, ::before, dark ::after, hover ::after, hover ::before, dark hover variants, and the :has() container) have the new [role="group"] selector added as a parallel comma rule. position: relative is now owned by the slot-reservation rule, removing reliance on Mintlify's utility class. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ensureFooterBtn called] --> B{isDesktop AND hasVisibleSidebar?}
B -- No --> C[removeFooterBtn]
B -- Yes --> D{footerBtn already in DOM?}
D -- Yes --> E[return early]
D -- No --> F["querySelector both generations\n#sidebar-content button or role=group"]
F --> G{theme element found?}
G -- No --> H[return — retry on next mutation]
G -- Yes --> I[createElement button.ls-nav-collapse-btn]
I --> J["insertBefore(footerBtn, theme.nextSibling)"]
J --> K[Footer button rendered next to theme switcher]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[ensureFooterBtn called] --> B{isDesktop AND hasVisibleSidebar?}
B -- No --> C[removeFooterBtn]
B -- Yes --> D{footerBtn already in DOM?}
D -- Yes --> E[return early]
D -- No --> F["querySelector both generations\n#sidebar-content button or role=group"]
F --> G{theme element found?}
G -- No --> H[return — retry on next mutation]
G -- Yes --> I[createElement button.ls-nav-collapse-btn]
I --> J["insertBefore(footerBtn, theme.nextSibling)"]
J --> K[Footer button rendered next to theme switcher]
Reviews (1): Last reviewed commit: "Docs: anchor the footer collapse button ..." | Re-trigger Greptile
Co-authored-by: Cursor <cursoragent@cursor.com>
7be4c63 to
5c2056e
Compare
…2px glyphs Mintlify's new three-option pill reads chunkier than the old two-icon toggle. Hide the system button (light/dark only), shrink the pill back to the classic 52px, and size the glyphs at 12px like the old lg:size-3 sun/moon. Co-authored-by: Cursor <cursoragent@cursor.com>
…for the classic crescent The system option is back (it holds the active state on load — hiding it left nothing selected). The new switcher's sun/system glyphs already match the old 16-grid/1.5-stroke family; only its Lucide moon read heavier, so that one glyph is mask-drawn from the old component's crescent path. Co-authored-by: Cursor <cursoragent@cursor.com>
…px absolute) The global svg non-scaling-stroke rule pins Mintlify's inline system + sun at their authored 1.5px even at 12px render, but can't reach a CSS mask — the crescent scaled to 1.125px and read thin. Author it at stroke 2 so the mask's x0.75 scale lands on the same 1.5px. Co-authored-by: Cursor <cursoragent@cursor.com>
Wrong direction last commit: the target weight is the crescent's fine 1.125px, not the pinned 1.5px. The crescent goes back to its authored 1.5 (masks always scale), and the switcher's inline system/sun svgs get a scoped vector-effect override so the site-wide non-scaling-stroke rule stops pinning them at 1.5px absolute. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
The footer sidebar-collapse button (#665) never rendered on production: Mintlify's evergreen hosted renderer has replaced the single
button[aria-label="Toggle dark mode"]with a three-option[role="group"][aria-label="Theme preference"]pill, while the pinned local CLI (4.2.284) still renders the old markup the feature was built and tested against. Every CSS anchor and the JS insertion point matched nothing on prod, so the button silently vanished (the rail was unaffected).relativeutility class (Greptile's earlier point, now load-bearing)Verified locally against the old markup (unchanged) and against prod's exact group markup transplanted into the live DOM (pixels anchor, hit target re-injects, click collapses).
Test plan
Made with Cursor