‹ Back to My Devblog
Debugging

On a dark documentation page, the sidebar had a nice thin orange scrollbar and everything else had the browser's default light one, arrows and all. Fixing that led to a more annoying bug: some pages scrolled sideways when they shouldn't.

One scrollbar style for everything

Now the page, the sidebar, the "On this page" list, code samples and (on a phone) tables all share one scrollbar. It's thin, rounded and orange, quiet at rest, brighter under the pointer and fully orange while dragged, with no arrow buttons. A single mixin, docs-scrollbar in _docs.scss, does all of it. The page's own bar is only styled where there is a documentation page (:root:has(.docs)), so no other page changes.

The catch with the standard properties

The sidebar's old style set scrollbar-width and scrollbar-color. In Chromium, setting those makes the browser ignore the custom bar and draw its own native thin one, arrows included. Those two now go to Firefox only, the same split the UI Builder's scrollbars use.

Why pages scrolled sideways

Three causes:

Verifying it

A test compiles the real stylesheet and checks the rules, including that the standard properties only appear inside the Firefox-only block. In headless Edge, every scroller computed to the custom bar, and 29 pages at desktop width and the same 29 at phone width had no sideways scroll. I haven't tried Firefox or Safari.