Scrollbar Style Generator
Design custom scrollbars with a live preview. Emits both standard scrollbar-color/width and WebKit pseudo-element rules, with warnings for invisible scrollbars.
Live preview
12px · autoLine 1: sample content for scrolling.
Line 2: sample content for scrolling.
Line 3: sample content for scrolling.
Line 4: sample content for scrolling.
Line 5: sample content for scrolling.
Line 6: sample content for scrolling.
Line 7: sample content for scrolling.
Line 8: sample content for scrolling.
Line 9: sample content for scrolling.
Line 10: sample content for scrolling.
Line 11: sample content for scrolling.
Line 12: sample content for scrolling.
Line 13: sample content for scrolling.
Line 14: sample content for scrolling.
Line 15: sample content for scrolling.
Line 16: sample content for scrolling.
Line 17: sample content for scrolling.
Line 18: sample content for scrolling.
Line 19: sample content for scrolling.
Line 20: sample content for scrolling.
Line 21: sample content for scrolling.
Line 22: sample content for scrolling.
Line 23: sample content for scrolling.
Line 24: sample content for scrolling.
Line 25: sample content for scrolling.
Line 26: sample content for scrolling.
Line 27: sample content for scrolling.
Line 28: sample content for scrolling.
Line 29: sample content for scrolling.
Line 30: sample content for scrolling.
Hover and drag the thumb to see the hover/active colors. Touch screens have no hover state.
Generated CSS
both · 33 lines/* Standard properties: Firefox and modern Chromium */
* {
scrollbar-width: auto;
scrollbar-color: #94a3b8 #e2e8f0;
}
/* WebKit pseudo-elements: Chrome, Edge and Safari */
::-webkit-scrollbar {
width: 12px;
height: 12px;
}
::-webkit-scrollbar-thumb {
background: #94a3b8;
border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
background: #64748b;
}
::-webkit-scrollbar-thumb:active {
background: #475569;
}
::-webkit-scrollbar-track {
background: #e2e8f0;
}
::-webkit-scrollbar-corner {
background: #e2e8f0;
}
Browser support
| Engine | Standard | WebKit | Applies |
|---|---|---|---|
| Chrome / Edge | scrollbar-color and scrollbar-width supported | Pseudo-elements supported | Both (WebKit rules win where they overlap) |
| Safari | Standard properties not supported | Pseudo-elements supported | WebKit rules only |
| Firefox | Standard properties supported | Pseudo-elements ignored | Standard block only |
Examples
Brand scrollbar
.pane, thumb #6366f1, track #e0e7ffStandard declarations plus WebKit thumb and track rulesOne snippet covers both modern Firefox and Chromium/Safari.
Minimal thin
Minimal thin presetscrollbar-width: thin; width: 6pxA compact overlay style that keeps a visible scroll affordance.
Custom selector
.scroller.scroller::-webkit-scrollbar { … }The class is prefixed onto every pseudo-element rule.
Invisible
Invisible presetCSS generated with an a11y warningThe tool explains that hidden scrollbars remove an important visual cue.
About this tool
The Scrollbar Style Generator builds cross-browser CSS for custom scrollbars from a small visual form. It emits the standard scrollbar-width and scrollbar-color properties alongside the WebKit pseudo-element family, so Firefox gets a styled scrollbar and Chromium or Safari get the thumb, track, corner and hover states they understand.
Colors, width, radius, borders and hover/active states are editable independently. Four presets cover the common cases — minimal thin, brand colored, chunky and deliberately invisible — and an output toggle emits both dialects, only the standard properties, or only the WebKit rules.
A scoped live preview styles a real scrollable pane without touching the tool's own chrome. Warnings flag hidden scrollbars and thumbs that share the track color, and a support matrix explains which declaration each engine actually uses. The optional scrollbar-gutter snippet helps prevent layout shift when scrollbars appear.
What this tool does not do
- Scrollbar buttons and vendor-specific pseudo-elements beyond the common family are not emitted.
- Hover states do not apply on touch devices; the active state still works.
- The preview reflects a Chromium/Safari-style scrollbar; Firefox's native rendering will differ even though its declarations are correct.
How to use this tool
Choose a target
Enter *, body or a class selector such as .scroll-area. Invalid selectors withhold the output and show a hint.
Set standard properties
Pick scrollbar-width (auto, thin or none) and the thumb/track pair used by the standard declarations.
Style WebKit details
Set width, thumb radius, borders, hover and active colors; each rule is emitted only when it has content.
Preview
Scroll the text, gallery or code pane to see hover and active states; the injected CSS is scoped to the preview container.
Copy
Choose both, standard-only or WebKit-only output, add the gutter snippet if needed, then copy or download the CSS.
Use cases
Chat panes and galleries
Match a custom scroll area to an app's visual language without breaking engine support.
Brand consistency
Keep the same thumb and track palette across browsers with one copied snippet.
Layout stability
Add scrollbar-gutter: stable so content does not jump when a scrollbar appears.
Emitted rules
| Block | Declarations |
|---|---|
| Standard | scrollbar-width, scrollbar-color and optional scrollbar-gutter on the target selector |
| WebKit | ::-webkit-scrollbar, -thumb, -thumb:hover, -thumb:active, -track and -corner rules |
| Global prefix | A bare ::-webkit-scrollbar when the selector is *; <selector>::-webkit-* otherwise |
| Preview | The same rules scoped under the preview container so the tool page is unaffected |
A scrollbar-width of none or a WebKit width of zero triggers a persistent accessibility warning rather than a silent style.
Common mistakes
Mistake:Using only ::-webkit-scrollbar rules and assuming they work everywhere.
Fix:Keep the both variant; Firefox honors the standard properties and ignores the pseudo-elements.
Mistake:Setting thumb and track to the same color.
Fix:The generator warns; choose two contrasting colors so the draggable thumb is visible.
Mistake:Hiding the scrollbar completely for looks.
Fix:Prefer the thin preset; the none mode warning explains the accessibility cost.
Frequently asked questions
Why doesn't ::-webkit-scrollbar work in Firefox?
Firefox does not implement the WebKit pseudo-elements. It supports the standard scrollbar-width and scrollbar-color properties instead. This tool emits both blocks together so each engine uses the syntax it understands.
Do scrollbar-width and the WebKit rules conflict?
They target different engines. Modern Chromium supports both, and its WebKit pseudo-elements take precedence where they overlap; Firefox reads only the standard declarations. Keeping both blocks is the safest cross-browser approach.
Can I style the scrollbar buttons?
Not portably. The classic WebKit button pseudo-elements are unsupported in current Chromium and Safari, so this generator focuses on the thumb, track and corner — the parts that work across engines.
Does custom scrollbar styling work on mobile?
Most mobile browsers use overlay scrollbars that appear only while scrolling and ignore custom colors. Hover states also do not apply on touch screens; the active state still functions where styling is honored.
How thin can a scrollbar get?
The WebKit width control accepts 0–30 px. A width of zero removes the scroll affordance entirely, so the tool shows an accessibility warning and recommends the thin preset instead.
What does scrollbar-gutter: stable do?
It reserves space for the scrollbar even when the content does not overflow, preventing layout shift as content changes. Add it with the gutter toggle; it is independent of the thumb and track colors.
Related tools
Aspect Ratio Calculator
Calculate dimensions and ratios for images and videos.
Border Radius Generator
Visually craft CSS border-radius values — including the advanced 8-value slash syntax for organic blob shapes — with a live preview and one-click copy.
Box Shadow Generator
Visual CSS box-shadow generator. Create beautiful shadows with live preview and copy the CSS code.
CSS :has() Selector Playground
Try the CSS :has() parent selector on live editable HTML and CSS, with ten patterns, dropped-rule detection and specificity notes.
CSS Button Generator
Design buttons with hover, active, focus-visible and disabled states — gradients, shadows, borders, icons — and copy clean CSS or Tailwind.
CSS Clip-Path Generator
Draw clip-path shapes visually: drag polygon points, tune circle/ellipse/inset presets, paste an SVG path and copy responsive CSS.