CSS Scrollbar Generator
About this generator
Style custom CSS scrollbars visually — width, thumb color, track color, hover state, padding, border-radius. The output ships both the modern scrollbar-color / scrollbar-width syntax (Firefox + 2024+ Chromium / Safari) and the legacy ::-webkit-scrollbar* pseudo-elements (Chrome / Safari / Edge — still ~10-15% of traffic on older versions). One copy, full cross-browser coverage.
Six curated presets — Minimal, GitHub, macOS, Neon, Thin (scoped to .scroll-area), Hidden — cover the common recipes. Live scrollable preview demonstrates every control via the WebKit syntax (the only one Chrome / Safari render with pixel precision).
Permalink: every adjustment encodes into the URL. No login, no watermark, no paywall. Free and MIT-licensed.
Why style scrollbars?
How to use this generator
Property reference
| Property | Browsers | Accepts |
|---|---|---|
scrollbar-width | Firefox + Chromium 121+ / Safari 18.2+ | auto, thin, none |
scrollbar-color | Firefox + Chromium 121+ / Safari 18.2+ | |
::-webkit-scrollbar | Chrome / Safari / Edge (all versions) | width, height (the bar size) |
::-webkit-scrollbar-track | Chrome / Safari / Edge | background, border-radius |
::-webkit-scrollbar-thumb | Chrome / Safari / Edge | background, border-radius, border |
::-webkit-scrollbar-thumb:hover | Chrome / Safari / Edge | all of the above |
::-webkit-scrollbar-thumb:active | Chrome / Safari / Edge | styles while dragging |
::-webkit-scrollbar-button | Chrome / Safari / Edge | rare; the up/down arrow buttons |
Common patterns
.scroll-area {
/* Standard (Firefox + 2024+ Chromium) */
scrollbar-width: thin;
scrollbar-color: #7c6cff transparent;
}
/* Legacy WebKit (Chrome / Safari / Edge) */
.scroll-area::-webkit-scrollbar {
width: 8px;
}
.scroll-area::-webkit-scrollbar-track {
background: transparent;
}
.scroll-area::-webkit-scrollbar-thumb {
background: #7c6cff;
border-radius: 999px;
}
.scroll-area::-webkit-scrollbar-thumb:hover {
background: #a78bfa;
}/* Modern */
.carousel { scrollbar-width: none; }
/* WebKit */
.carousel::-webkit-scrollbar { display: none; }
/* Still scrollable — content just lacks the visual bar. *//* Auto-adapts to dark mode using a CSS custom property. */
:root {
--scrollbar-thumb: #b0b0b0;
--scrollbar-track: #f0f0f0;
}
@media (prefers-color-scheme: dark) {
:root {
--scrollbar-thumb: #5a5a72;
--scrollbar-track: #1a1a22;
}
}
body {
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
body::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); }
body::-webkit-scrollbar-track { background: var(--scrollbar-track); }Pro tips
Frequently asked questions
Why does the generator output two different CSS blocks?
Because cross-browser scrollbar styling has been split across two syntaxes for years. The standard syntax (scrollbar-width + scrollbar-color) is a 2024-modern CSS feature that Firefox shipped first (~2018) and Chromium / Safari only adopted in 2024. It gives you two knobs: thin/auto width + thumb/track color. The legacy WebKit syntax (::-webkit-scrollbar*) gives you full control over track, thumb, hover state, padding, border-radius — but only renders in WebKit-based browsers (Chrome, Safari, Edge, older Firefox doesn't support it). The Copy combined button gives you both — modern browsers use whichever they prefer, legacy WebKit still gets pixel-precise control.
Why does my preview look different in Firefox than Chrome?
Firefox can't render ::-webkit-scrollbar rules — they're a non-standard Chromium / Safari extension. The live preview in this generator deliberately uses ONLY the WebKit syntax (so every knob — thumb radius, padding, hover — demonstrates its effect to Chrome / Safari users, who are the dominant audience). The exported CSS includes both syntaxes, so your real site will style correctly in Firefox via scrollbar-color. If you need perfect Firefox parity in the preview, open the deployed page in Firefox — the exported CSS does its job there.
Should I use scrollbar-width: thin or set width via ::-webkit-scrollbar?
Use both. scrollbar-width: thin gives Firefox a 6-8px scrollbar (the exact pixel value is browser-controlled — there's no way to set it precisely). ::-webkit-scrollbar { width: Npx } gives WebKit-based browsers pixel-precise control. The generator outputs both with the closest mapping (width <= 8 → thin in standard, otherwise auto), so the exported CSS gives the best result in each browser. If you only need Firefox + 2024+ Chromium, the standard syntax alone is enough; if you need polish in older browsers, keep the WebKit syntax too.
How do I hide the scrollbar entirely?
Pick the Hidden preset (or set Behavior to Hidden). The output is scrollbar-width: none + ::-webkit-scrollbar { display: none }. The element stays scrollable — scroll wheel, swipe, arrow keys, JavaScript scrollTo all still work — but the visual scrollbar disappears. Use this for: full-screen image galleries, custom-built scrollbars overlayed via JS, mobile UIs where the iOS-style bouncy scroll is enough indicator. Don't use it for general content scrolling — sighted users use the scrollbar to know how much content remains.
Why doesn't my scrollbar styling work on iOS Safari?
iOS Safari uses native momentum-scrolling and doesn't expose the scrollbar to CSS — the system overlay scrollbar appears during scroll and disappears afterward. ::-webkit-scrollbar works on macOS Safari but not iOS Safari for OS-managed scroll surfaces. For in-app custom scroll containers (an element with overflow: auto and a fixed height), it works on iOS Safari 14+. For the document scrollbar on iOS, there's no styling API — the OS owns it.
Is the WebKit prefix going away? Should I bother with the legacy syntax?
The standard scrollbar-* properties are now shipping in all evergreen browsers (Chrome 121+, Edge 121+, Safari 18+, Firefox always). For new projects targeting only those, scrollbar-color + scrollbar-width is sufficient. The legacy ::-webkit-scrollbar syntax is still useful when you need: (1) per-state hover styling (the standard syntax only takes one color pair), (2) thumb border-radius / padding control, (3) support for Chrome <121 or Safari <18 which still has significant user share (~10-15% as of mid-2026). For most production sites, ship both — total CSS overhead is ~15 lines and you get correct rendering everywhere.
Is this free for commercial use?
Free, MIT-licensed, zero attribution required, no watermark, no signup. Use on any project — personal, client, enterprise — without permission.