Skip to content
Jellykit

Scrollbar Styler

Design a custom scrollbar with live preview and copy CSS that uses both scrollbar-color and the WebKit scrollbar pseudo-elements.

  • Runs on your device
Loading tool

About Scrollbar Styler

Pick a thumb color, a hover color and a track color, set the width, roundness and inset of the thumb, and scroll a live preview box to judge the result. The tool writes CSS for every engine: the standard scrollbar-color and scrollbar-width properties, which Firefox and Chromium read, and the ::-webkit-scrollbar pseudo-elements, which Safari and Chromium read.

Because Chromium ignores the WebKit rules on any element that also sets the standard properties, you can choose which set Chromium follows. The tool also measures the contrast between thumb and track, so the scrollbar stays easy to see.

How it works

  1. The standard rule sets scrollbar-color to the thumb and track colors and, if you choose Thin, scrollbar-width: thin. Those two properties are all the standard offers: no exact width, roundness or hover color.
  2. The WebKit rules style ::-webkit-scrollbar for the width, the track and the corner, and ::-webkit-scrollbar-thumb for the color, radius and hover color. The inset is a transparent border clipped from the thumb’s background.
  3. With WebKit chosen for Chromium, the standard rule is wrapped in @supports not selector(::-webkit-scrollbar), so it applies only in browsers without the pseudo-elements, such as Firefox.
  4. A selector list such as ".a, .b" is split at its commas, and each part gets its own pseudo-element.

Questions

Why does my scrollbar look different in Firefox?

Firefox reads only the standard properties, which set two colors and a choice of auto or thin. Exact width, rounded corners and hover colors exist only in the WebKit rules.

Why does nothing change on my phone or Mac?

Mobile browsers and macOS, when set to show scrollbars only while scrolling, draw overlay scrollbars that ignore most styling. The preview shows what your browser does with the rules.

Can I style the scrollbar of the whole page?

Yes. Use html as the selector. The colors then apply to the page’s own scrollbar, and inner scrolling areas inherit the standard colors unless they set their own.

Is a custom scrollbar accessible?

It can be. Keep the thumb at least 3 : 1 against the track, as WCAG asks of interface parts, and do not make it too thin to grab. The tool warns when the contrast falls short.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.