Skip to content

Draw the scrollbar with OverlayScrollbars (3.2.0) - #36

Merged
uiwwsw merged 1 commit into
mainfrom
feat/overlayscrollbars
Nov 26, 2026
Merged

uiwwsw merged 1 commit into
mainfrom
feat/overlayscrollbars

Conversation

@uiwwsw

@uiwwsw uiwwsw commented Nov 26, 2026

Copy link
Copy Markdown
Owner
  • Replace the self-drawn thumb with OverlayScrollbars 2.17: drag, track click, auto-hide; handle moved by ScrollTimeline where supported; native scrolling kept (window.scrollTo verified in the demo).
  • Keep the provider's track logic (between fixed bars, fitted to the target content box, follows the active scroller). The track is placed per layout change, not per scroll.
  • Bundle OverlayScrollbars CSS into dist/style.css; exports ./style.css now points there.
  • README: market comparison with SSGOI, next-view-transitions and Stackflow, checked against their docs/source.

Checked in the demo (Chrome): track 52–711px between header and tab bar, drag 150 frame px → scrollY 100→571 (expected 570), track click scrolls one viewport, route push/back keeps scroll restore and a single scrollbar instance.
npm test 58 pass, check, build, verify-release (packed tarball installed in a consumer), next build of the demo.

🤖 Generated with Claude Code

The handle was drawn by our own code and could not be dragged or clicked,
and the native scrollbar stayed hidden. OverlayScrollbars keeps native
scrolling (window.scrollTo, keyboard, touch), moves its handle with a
ScrollTimeline where supported, and adds drag, track click and
auto-hide. The document uses <html> as its viewport and an element is its
own viewport, so no app DOM is wrapped.

The provider still computes the track: between fixed headers, footers and
tab bars, fitted to the scroll target's content box, following whichever
scroller moved. The slot is placed once per layout change instead of on
every scroll. edgeBounce now scales the drawn handle.

OverlayScrollbars' base CSS is bundled into dist/style.css, so apps still
import a single style.css. Tests cover track placement and source
switching with a stub scrollbar. Release 3.2.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@uiwwsw
uiwwsw merged commit 9955f3e into main Nov 26, 2026
2 checks passed
@uiwwsw
uiwwsw deleted the feat/overlayscrollbars branch November 26, 2026 01:56
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