Docs: visible sidebar-collapse button in the footer + tooltips on the toggles#665
Conversation
… toggles The edge rail only reveals on hover, so collapse was hard to discover. A button now sits right of the theme switcher wearing its exact chrome; its pixels are pseudo-elements of the server-rendered switcher (visible from first paint — Mintlify runs custom JS well after paint) and the injected button is just the invisible hit target. Both toggles get inverted mono tooltips with hover-intent, a rise/slide entry, and a mute-until-re-entry guard so the copy never swaps mid-air on toggle. The global squircle rule now covers pseudo-elements so CSS-drawn chrome corner-smooths like everything else. Co-authored-by: Cursor <cursoragent@cursor.com>
…target; its pixels are the switcher's pseudo-elements 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 makes the Mintlify sidebar collapse control easier to find. The main changes are:
Confidence Score: 4/5The footer collapse button layout needs a small fix before merging.
mintlify/style.css
|
| Filename | Overview |
|---|---|
| mintlify/sidebar-toggle.js | Adds the shared animated toggle path and lifecycle management for the footer collapse button. |
| mintlify/style.css | Adds the CSS-drawn footer collapse button, hover states, tooltips, and pseudo-element squircle coverage. |
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
mintlify/style.css:4486-4488
**Pseudo Button Anchors Wrong**
The new collapse-button pixels are absolute `::before` and `::after` children of the theme switcher, but this rule does not make the switcher their containing block. On the first paint, `left: calc(100% + 8px)` can resolve against the footer row instead of the switcher, placing the visible circle away from the invisible `.ls-nav-collapse-btn` hit target or clipping it at the sidebar edge.
```suggestion
#sidebar-content > div > button[aria-label="Toggle dark mode"] {
position: relative;
margin-right: 36px;
}
```
Reviews (1): Last reviewed commit: "Docs: fix stale comment — the footer col..." | Re-trigger Greptile
| #sidebar-content > div > button[aria-label="Toggle dark mode"] { | ||
| margin-right: 36px; | ||
| } |
There was a problem hiding this comment.
The new collapse-button pixels are absolute ::before and ::after children of the theme switcher, but this rule does not make the switcher their containing block. On the first paint, left: calc(100% + 8px) can resolve against the footer row instead of the switcher, placing the visible circle away from the invisible .ls-nav-collapse-btn hit target or clipping it at the sidebar edge.
| #sidebar-content > div > button[aria-label="Toggle dark mode"] { | |
| margin-right: 36px; | |
| } | |
| #sidebar-content > div > button[aria-label="Toggle dark mode"] { | |
| position: relative; | |
| margin-right: 36px; | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/style.css
Line: 4486-4488
Comment:
**Pseudo Button Anchors Wrong**
The new collapse-button pixels are absolute `::before` and `::after` children of the theme switcher, but this rule does not make the switcher their containing block. On the first paint, `left: calc(100% + 8px)` can resolve against the footer row instead of the switcher, placing the visible circle away from the invisible `.ls-nav-collapse-btn` hit target or clipping it at the sidebar edge.
```suggestion
#sidebar-content > div > button[aria-label="Toggle dark mode"] {
position: relative;
margin-right: 36px;
}
```
How can I resolve this? If you propose a fix, please make it concise.|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Summary
The sidebar collapse affordance was hard to discover — the edge rail only reveals on hover. This adds a visible collapse button in the sidebar footer, plus tooltips on both toggles:
animatedToggle()); reopening stays the rail's job since the footer hides when collapsed.pointer-events: noneso a pre-mount click can't flip the theme), and the injected button is just the invisible hit target mounted over them. Hover rides:has()back onto the pseudos, so the pixels have exactly one owner.* { corner-shape: squircle }matches elements only; it now covers::before/::aftertoo, so CSS-drawn chrome (this button, the tooltips, the(0, 0, 0)tag) corner-smooths like everything around it.Test plan
(0, 0, 0)footer tag unaffected; theme switcher unaffectedMade with Cursor