Skip to content

fix(theme/nav): Fixed small layout shift on scroll#2980

Merged
SoonIter merged 1 commit intoweb-infra-dev:mainfrom
elliotcourant:fix/scroll-nav-layout-shift
Jan 9, 2026
Merged

fix(theme/nav): Fixed small layout shift on scroll#2980
SoonIter merged 1 commit intoweb-infra-dev:mainfrom
elliotcourant:fix/scroll-nav-layout-shift

Conversation

@elliotcourant
Copy link
Contributor

Summary

When scrolling: as the nav bar transitions to having a bottom border and a blurred background, the layout of the icons would shift up slightly due to the bottom border size changing. To fix this I've made it so that the bottom border is always 1px but is transparent by default. This prevents the layout shift when scrolling.

Super tiny PR but spotted this while experimenting with the latest release candidate.

Before

stylebug-2026-01-08_20.08.19.mp4

After

stylebug-fixed-2026-01-08_20.10.10.mp4

Related Issue

N/A

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

When scrolling: as the nav bar transitions to having a bottom border and
a blurred background, the layout of the icons would shift up slightly
due to the bottom border size changing. To fix this I've made it so that
the bottom border is always 1px but is transparent by default. This
prevents the layout shift when scrolling.
Copilot AI review requested due to automatic review settings January 9, 2026 02:15
@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit ca82d8a
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/696064b121610a0008b39b1c
😎 Deploy Preview https://deploy-preview-2980--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a minor layout shift issue that occurs when scrolling causes the navigation bar to transition from transparent to having a visible bottom border. The fix ensures the border remains 1px at all times, only changing from transparent to visible, which prevents the navigation icons from shifting vertically during scroll.

Key changes:

  • Modified the CSS rule for the navigation bar to maintain a constant 1px transparent border instead of no border when at the top of the page

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@SoonIter SoonIter left a comment

Choose a reason for hiding this comment

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

hugely thanks ❤️️

@SoonIter SoonIter merged commit 8bf1fd8 into web-infra-dev:main Jan 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants