Skip to content

Conversation

@Golenspade
Copy link

Summary

Fixes #4574 - Aligns navbar mobile padding with article content padding to eliminate visual misalignment.

Problem

The navbar's mobile horizontal padding (1.5rem/24px) was inconsistent with the article content padding (1rem/16px), creating visual misalignment and excessive "vertical lines" in the mobile layout.

Solution

  • Changed navbar padding on mobile from 1.5rem to 1rem using responsive Tailwind classes
  • Desktop padding remains 1.5rem via md: breakpoint
  • Now perfectly aligns with article content (x:px-4 = 1rem)

Changes

File: packages/nextra-theme-docs/src/components/navbar/index.tsx

- x:pl-[max(env(safe-area-inset-left),1.5rem)] x:pr-[max(env(safe-area-inset-right),1.5rem)]
+ x:pl-[max(env(safe-area-inset-left),1rem)] x:pr-[max(env(safe-area-inset-right),1rem)]
+ x:md:pl-[max(env(safe-area-inset-left),1.5rem)] x:md:pr-[max(env(safe-area-inset-right),1.5rem)]

Impact

  • ✅ Mobile navbar content aligns with page content
  • ✅ Desktop layout unchanged (maintains 1.5rem padding)
  • ✅ Consistent UX across mobile viewports (320px - 768px)
  • ✅ Fixes visual "vertical lines" issue mentioned in Fix navbar mobile vertical UX line alignment #4574

Testing

Tested on mobile viewports:

  • ✅ 320px (iPhone SE)
  • ✅ 375px (iPhone 12/13)
  • ✅ 768px (iPad Mini)
  • ✅ Desktop (1440px+) - padding remains unchanged

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

## Problem

Issue shuding#4574 reported that the navbar's mobile horizontal padding (1.5rem/24px) was inconsistent with the article content padding (1rem/16px), creating visual misalignment and excessive vertical lines in the mobile layout.

## Solution

- Changed navbar padding on mobile from `1.5rem` to `1rem` using responsive Tailwind classes
- Desktop padding remains `1.5rem` via `md:` breakpoint
- Now perfectly aligns with article content (`x:px-4` = `1rem`)

## Impact

- ✅ Mobile navbar content aligns with page content
- ✅ Desktop layout unchanged (maintains 1.5rem padding)
- ✅ Consistent UX across mobile viewports
- ✅ Fixes visual "vertical lines" issue mentioned in shuding#4574

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Oct 1, 2025

🦋 Changeset detected

Latest commit: 6dcae41

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
nextra-theme-docs Patch
nextra Patch
nextra-theme-blog Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Oct 1, 2025

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

Project Deployment Preview Comments Updated (UTC)
nextra Error Error Oct 1, 2025 2:53pm
nextra-v2 Ready Ready Preview Comment Oct 1, 2025 2:53pm

@vercel
Copy link

vercel bot commented Oct 1, 2025

@Golenspade is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

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.

Fix navbar mobile vertical UX line alignment

1 participant