Skip to content

Fix sidebar padding under Mintlify's new prod sidebar markup#696

Merged
patcapulong merged 3 commits into
mainfrom
pat/sidebar-padding-fix
Jul 17, 2026
Merged

Fix sidebar padding under Mintlify's new prod sidebar markup#696
patcapulong merged 3 commits into
mainfrom
pat/sidebar-padding-fix

Conversation

@patcapulong

@patcapulong patcapulong commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Problem

Production docs show doubled sidebar padding (~52px inset) and group divider lines that no longer reach the sidebar edges.

Mintlify's hosted platform shipped a new sidebar renderer (base-ui scroll-area), while our pinned local CLI (4.2.284) still renders the old markup — so the bug only appears in prod. Same failure mode as #672 (footer collapse button).

What changed in prod markup:

  • #navigation-items is now a scroll-area wrapper; Mintlify's px-7 py-6 padding moved to an inner viewport div. Our padding: 24px override stacked on top of it instead of replacing it.
  • id="sidebar-group" was dropped from group <ul>s (the sidebar-group class remains), killing ~79 selector lines (API-reference group icons, chevrons, alignment).
  • Group titles changed from <h5 id="sidebar-title"> to <h3 class="sidebar-title">.

Fix

All in mintlify/style.css, written to work with both old (local CLI) and new (prod) markup:

  • Zero out padding on the scroll-area wrapper and apply 24px to the inner viewport instead
  • Swap #sidebar-group id selectors to .sidebar-group class selectors (present in both markups; rules all use !important so specificity is unaffected)
  • Cover h3.sidebar-title in the group label rules and the relocated .text-sm container

Verification

  • Local dev (old markup) renders unchanged
  • Prod-side fix verified against live HTML from docs.lightspark.com — please double-check on the Mintlify preview deployment

Out of scope

#mobile-nav rules also appear to no longer match prod markup; will handle mobile nav in a follow-up.

Made with Cursor

Also included

Added icons to the three API-reference sidebar groups that were missing them:

  • Contact VerificationIconEmail2Check (new asset, extracted from Central Icons 1.1.296 round-outlined-radius-3-stroke-1.5)
  • Cards → existing credit-card1.svg
  • Stablecoins → existing coins.svg

…bar markup

Production Mintlify now renders #navigation-items as a base-ui scroll-area
wrapper: the px-7/py-6 padding moved to an inner viewport div, the
ul#sidebar-group id was dropped (class remains), and group titles became
h3.sidebar-title. Our padding override was stacking 24px on the wrapper on
top of the viewport's own 28px, doubling the sidebar inset.

- Zero out padding on the scroll-area wrapper and apply 24px to the viewport
- Add scroll-area-content fallback for the .text-sm container rule
- Swap #sidebar-group id selectors to .sidebar-group class (matches both
  old CLI markup and new prod markup)
- Cover h3.sidebar-title in the group label rules

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jul 17, 2026 3:32am
grid-wallet-demo Ignored Ignored Preview Jul 17, 2026 3:32am

Request Review

@mintlify

mintlify Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Grid 🟢 Ready View Preview Jul 17, 2026, 3:01 AM

@greptile-apps

greptile-apps Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates mintlify/style.css to fix a doubled sidebar padding (~52px) and misaligned group dividers that appeared only in the Mintlify-hosted production environment, caused by a new base-ui scroll-area markup that ships in prod but not in the pinned local CLI (v4.2.284).

  • Adds scroll-area-aware overrides: zeroes out padding on the wrapper #navigation-items[data-component-part="scroll-area"] and re-applies 24px to the inner viewport, preventing the stacking of Mintlify's native px-7/py-6 and the custom 24px override.
  • Replaces ~79 #sidebar-group id selectors with .sidebar-group class selectors (class is present in both old and new markup), and adds h3.sidebar-title / .sidebar-group-header .sidebar-title to cover the renamed group-title element in production.

Confidence Score: 4/5

Safe to merge — changes are CSS-only overrides that degrade gracefully if selectors don't match.

The bulk of the change is a straightforward mechanical selector swap that is low risk. The scroll-area padding split correctly prevents double-stacking. Two minor issues: a duplicate mobile-nav selector is dead code, and the base flex properties on the wrapper are not explicitly reset in the scroll-area override block.

mintlify/style.css — specifically the scroll-area override block (lines 888–894) and the mobile nav selector list (lines 864–867).

Important Files Changed

Filename Overview
mintlify/style.css Large mechanical swap of ~79 #sidebar-group id selectors to .sidebar-group class selectors, plus new scroll-area padding rules and h3.sidebar-title coverage; one duplicate mobile-nav selector and an unreviewed flex-layout interaction on the scroll-area wrapper are minor concerns.

Comments Outside Diff (1)

  1. mintlify/style.css, line 873-894 (link)

    P2 Flex layout not reset on scroll-area wrapper

    The base #navigation-items rule forces display: flex, flex-direction: column, and gap: 0 with !important. The new scroll-area override only resets padding — those flex properties remain on the wrapper element in the new markup. If base-ui's scroll-area relies on its own positioning or block layout for the viewport + scrollbar children, applying display: flex to the wrapper can cause the scrollbar overlay to mis-position or the viewport to collapse. If production looks correct now, it's worth adding an explicit reset (display: block !important or equivalent) to the scroll-area override rule so the intent is clear and future Mintlify updates don't silently break it.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: mintlify/style.css
    Line: 873-894
    
    Comment:
    **Flex layout not reset on scroll-area wrapper**
    
    The base `#navigation-items` rule forces `display: flex`, `flex-direction: column`, and `gap: 0` with `!important`. The new scroll-area override only resets `padding` — those flex properties remain on the wrapper element in the new markup. If base-ui's scroll-area relies on its own positioning or block layout for the viewport + scrollbar children, applying `display: flex` to the wrapper can cause the scrollbar overlay to mis-position or the viewport to collapse. If production looks correct now, it's worth adding an explicit reset (`display: block !important` or equivalent) to the scroll-area override rule so the intent is clear and future Mintlify updates don't silently break it.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
mintlify/style.css:864-867
The conversion of `div#mobile-nav ul#sidebar-group` to `div#mobile-nav ul.sidebar-group` created an exact duplicate of the line immediately above it. Both entries now target the same selector, so the second line provides no additional coverage. Since the PR description confirms `.sidebar-group` class is present in both old and new markup, a single class selector is sufficient — but the duplicate is dead weight that will cause confusion if the selector list ever needs to be extended.

```suggestion
/* Mobile nav - sidebar group list: adjust spacing */
div#mobile-nav ul.sidebar-group,
#mobile-nav .sidebar-group-header + ul {
```

### Issue 2 of 2
mintlify/style.css:873-894
**Flex layout not reset on scroll-area wrapper**

The base `#navigation-items` rule forces `display: flex`, `flex-direction: column`, and `gap: 0` with `!important`. The new scroll-area override only resets `padding` — those flex properties remain on the wrapper element in the new markup. If base-ui's scroll-area relies on its own positioning or block layout for the viewport + scrollbar children, applying `display: flex` to the wrapper can cause the scrollbar overlay to mis-position or the viewport to collapse. If production looks correct now, it's worth adding an explicit reset (`display: block !important` or equivalent) to the scroll-area override rule so the intent is clear and future Mintlify updates don't silently break it.

Reviews (1): Last reviewed commit: "Fix sidebar padding + broken selectors u..." | Re-trigger Greptile

Comment thread mintlify/style.css
Comment on lines 864 to 867
/* Mobile nav - sidebar group list: adjust spacing */
div#mobile-nav ul.sidebar-group,
div#mobile-nav ul#sidebar-group,
div#mobile-nav ul.sidebar-group,
#mobile-nav .sidebar-group-header + ul {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The conversion of div#mobile-nav ul#sidebar-group to div#mobile-nav ul.sidebar-group created an exact duplicate of the line immediately above it. Both entries now target the same selector, so the second line provides no additional coverage. Since the PR description confirms .sidebar-group class is present in both old and new markup, a single class selector is sufficient — but the duplicate is dead weight that will cause confusion if the selector list ever needs to be extended.

Suggested change
/* Mobile nav - sidebar group list: adjust spacing */
div#mobile-nav ul.sidebar-group,
div#mobile-nav ul#sidebar-group,
div#mobile-nav ul.sidebar-group,
#mobile-nav .sidebar-group-header + ul {
/* Mobile nav - sidebar group list: adjust spacing */
div#mobile-nav ul.sidebar-group,
#mobile-nav .sidebar-group-header + ul {
Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/style.css
Line: 864-867

Comment:
The conversion of `div#mobile-nav ul#sidebar-group` to `div#mobile-nav ul.sidebar-group` created an exact duplicate of the line immediately above it. Both entries now target the same selector, so the second line provides no additional coverage. Since the PR description confirms `.sidebar-group` class is present in both old and new markup, a single class selector is sufficient — but the duplicate is dead weight that will cause confusion if the selector list ever needs to be extended.

```suggestion
/* Mobile nav - sidebar group list: adjust spacing */
div#mobile-nav ul.sidebar-group,
#mobile-nav .sidebar-group-header + ul {
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@mintlify

mintlify Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Grid 🟡 Building Jul 17, 2026, 3:00 AM

… overlap

- The first-group bottom padding rule used a direct-child selector
  (#navigation-items > .text-sm) that no longer matches the new scroll-area
  nesting; use a descendant selector that matches both markups.
- The id-to-class swap dropped the group-icon padding rule below the generic
  '#navigation-items li[class*=space-y] > button' padding rule in specificity,
  so button text rendered under the absolutely-positioned ::before icons.
  Prefix the affected .sidebar-group rules with #navigation-items to restore
  id-level specificity.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Contact Verification: IconEmail2Check (Central Icons 1.1.296,
  round-outlined-radius-3-stroke-1.5, converted to the sidebar SVG convention)
- Cards: existing credit-card1.svg
- Stablecoins: existing coins.svg

Co-authored-by: Cursor <cursoragent@cursor.com>
@patcapulong
patcapulong merged commit 697eb64 into main Jul 17, 2026
8 checks passed
@patcapulong
patcapulong deleted the pat/sidebar-padding-fix branch July 17, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants