Skip to content

fix: sticky header horizontal shift caused by scrollbar width#2949

Open
CloudWaddie wants to merge 1 commit into
stackernews:masterfrom
CloudWaddie:fix/sticky-header-shift
Open

fix: sticky header horizontal shift caused by scrollbar width#2949
CloudWaddie wants to merge 1 commit into
stackernews:masterfrom
CloudWaddie:fix/sticky-header-shift

Conversation

@CloudWaddie

@CloudWaddie CloudWaddie commented May 10, 2026

Copy link
Copy Markdown

Summary

  • Fixes Sticky header slightly shifted #2346
  • The .sticky header used width: 100vw which includes the scrollbar width, causing a slight horizontal shift compared to the non-sticky header
  • Replaced with left: 0; right: 0 which correctly excludes scrollbar width for position: fixed elements

Replace `width: 100vw` with `left: 0; right: 0` on the sticky header.
`100vw` includes the scrollbar width, causing the fixed header content
to be slightly shifted compared to the non-sticky header which respects
the actual viewport width minus the scrollbar.

Fixes stackernews#2346

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sir-opti

Copy link
Copy Markdown
Contributor

This looks ok for QA

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.

Sticky header slightly shifted

2 participants