Skip to content

fix(ui): align mobile nav menu items with divider lines#136

Merged
danielnaab merged 9 commits intomainfrom
fix/mobile-nav-alignment
May 7, 2026
Merged

fix(ui): align mobile nav menu items with divider lines#136
danielnaab merged 9 commits intomainfrom
fix/mobile-nav-alignment

Conversation

@danielnaab
Copy link
Copy Markdown
Member

Summary

  • Mobile nav slide-out panel has padding: 1rem providing overall inset, but nav links added a redundant padding-inline: 1rem, pushing link text 1rem further inward than the border separator lines between items
  • Removed the extra inline padding so menu item text aligns flush with the divider guide lines

Test plan

  • Open site on mobile viewport (< 1024px) and tap Menu
  • Verify nav item text is aligned with the horizontal divider lines between items
  • Verify user panel section (avatar, sign out) also aligns with nav items
  • Verify touch targets remain usable (full-width links still clickable)

danielnaab added 2 commits May 7, 2026 21:08
The mobile nav panel has padding: 1rem, but nav links added an
additional padding-inline: 1rem, causing link text to be inset from
the border separator lines between items. Remove the redundant
inline padding so text aligns flush with the dividers.
The close button used float:right which is ignored in flex containers,
causing it to consume a full row (~4rem) of vertical space and push
nav items down. Position it absolutely in the top-right corner instead.
Also remove the first nav item's top border and the redundant link
inline padding so items align flush with the panel's divider lines.
@danielnaab danielnaab temporarily deployed to fix-mobile-nav-alignment May 7, 2026 21:15 Inactive
- Close button: use align-self: flex-end with negative margins instead
  of absolute positioning (which overlapped first two nav items)
- User panel: reset full padding (not just padding-inline) on mobile
  to eliminate inherited desktop spacing
- Settings link and signout button: zero out padding-inline on mobile
  so text aligns with nav links and divider lines
@danielnaab danielnaab temporarily deployed to fix-mobile-nav-alignment May 7, 2026 21:20 Inactive
danielnaab added 2 commits May 7, 2026 21:24
Root cause: float:right on the close button is ignored in flex
containers, so it consumed ~3.25rem of vertical space as a flex row
instead of floating out of flow. This pushed nav items down by
roughly two section-heights.

Fix:
- Close button: position absolute in top-right corner (restoring
  the original float:right intent without consuming flow space)
- First nav item: remove top border (no orphan line at list top)
- Nav links: padding-inline 0 so text aligns with divider lines
  (panel padding already provides the overall inset)
Root cause: the close button's base styles (float:right, margin with
1rem bottom) were never fully neutralized in the mobile override.
In a flex column container float is ignored, so the button consumed
~3.25rem as a flex row. Previous fix attempts added position:absolute
but left float and margin inherited, which could still affect layout
on iOS WebKit.

Fix: explicitly reset float:none and margin:0 alongside position:
absolute, using physical properties (top/right) for maximum browser
compatibility. Also remove first-child top border and zero out nav
link inline padding so text aligns flush with divider lines.
@danielnaab danielnaab temporarily deployed to fix-mobile-nav-alignment May 7, 2026 21:50 Inactive
The design system switched spacing tokens to px units, but the header
component still used hardcoded rem values. On iOS, rem can resolve
differently than expected. Convert mobile nav styles to px and token
variables for consistency with the rest of the design system:
- padding: 1rem → var(--flex-space-md)
- close button insets: 0.5rem → var(--flex-space-sm)
- nav link padding: 0.75rem → 12px
- panel width/animation: 15rem → 240px
@danielnaab danielnaab temporarily deployed to fix-mobile-nav-alignment May 7, 2026 22:13 Inactive
Root cause: the mobile nav used display:flex, which silently disabled
float:right on the close button. The nav-list (also display:flex)
created a block formatting context that couldn't overlap the float.
Combined with hardcoded rem values (vs the design system's px tokens),
this caused the close button to consume ~3.25rem of vertical space,
pushing nav items down by roughly two section-heights.

Rewrite the mobile nav panel to use display:block throughout:
- Nav panel: display:block (via .is-visible), not flex
- Nav list: display:block, not flex — no BFC, float works naturally
- Nav links: display:block with block-size:auto (override desktop 100%)
- Close button: float:right works as originally designed
- All rem values → px or design token variables
- Physical properties (top/right/bottom) for iOS compatibility
- First nav item border removed, link padding-inline zeroed
@danielnaab danielnaab temporarily deployed to fix-mobile-nav-alignment May 7, 2026 22:40 Inactive
danielnaab added 2 commits May 7, 2026 22:43
Replace hardcoded 12px with var(--flex-space-sm) to stay on the
design system's spacing scale.
Sort imports to satisfy biome organizeImports rule.
@danielnaab danielnaab merged commit e9dd6b4 into main May 7, 2026
4 checks passed
@danielnaab danielnaab deleted the fix/mobile-nav-alignment branch May 7, 2026 22:48
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.

1 participant