Skip to content

fix(style): use standard scrollbar properties to stop layout shift - #2

Merged
andrii-bodnar merged 1 commit into
mainfrom
fix/style-scrollbar-layout-shift
Sep 15, 2026
Merged

andrii-bodnar merged 1 commit into
mainfrom
fix/style-scrollbar-layout-shift

Conversation

@andrii-bodnar

Copy link
Copy Markdown
Member

::-webkit-scrollbar { width: 6px } opts the page out of macOS overlay scrollbars into classic ones that take layout space. When a Radix modal (dialog, context menu, select) locks body scroll, that 6px disappears and viewport-positioned content jumps sideways.

Replace the four webkit rules with scrollbar-width: thin and scrollbar-color on :root. Same thin, themed look on classic-scrollbar platforms; overlay scrollbars stay overlay, so nothing shifts. Update the theme generator test accordingly.

`::-webkit-scrollbar { width: 6px }` opts the page out of macOS overlay
scrollbars into classic ones that take layout space. When a Radix modal
(dialog, context menu, select) locks body scroll, that 6px disappears and
viewport-positioned content jumps sideways.

Replace the four webkit rules with `scrollbar-width: thin` and
`scrollbar-color` on `:root`. Same thin, themed look on classic-scrollbar
platforms; overlay scrollbars stay overlay, so nothing shifts. Update the
theme generator test accordingly.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@andrii-bodnar
andrii-bodnar merged commit c642db0 into main Sep 15, 2026
1 check passed
@andrii-bodnar
andrii-bodnar deleted the fix/style-scrollbar-layout-shift branch September 15, 2026 07:46
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