CSSApril 2026·9 min read

CSS Scrollbars & Custom UI Chrome

Default browser scrollbars and cursors work fine, but they can clash with a carefully designed dark-mode interface or branded experience. This guide covers how to customize scrollbars and cursors with pure CSS — the standard approach, the WebKit approach, and practical patterns for both.

📜
Try the Scrollbar Styler
Design custom scrollbars visually and copy the CSS — free, no signup
DG
Derek Giordano
Designer & Developer
In this guide
01WebKit Scrollbar Styling02scrollbar-color & scrollbar-width03Cross-Browser Strategy04Dark Mode Scrollbars05Overlay & Auto-Hide Scrollbars06Custom CSS Cursors07Built-in Cursor Values08Custom Cursor Images09Performance Considerations
⚡ Key Takeaways
  • Customize browser scrollbars and cursor styles with pure CSS.
  • Covers webkit scrollbar styling.
  • Covers scrollbar-color & scrollbar-width.
  • Covers cross-browser strategy.
  • Covers dark mode scrollbars.

WebKit Scrollbar Styling

Chrome, Safari, Edge, and other WebKit/Blink browsers support a set of pseudo-elements that give you full control over scrollbar appearance. This approach has been available for over a decade and remains the most flexible option for scrollbar customization.

::-webkit-scrollbar { width: 8px; /* Vertical scrollbar width */ height: 8px; /* Horizontal scrollbar height */ } ::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 4px; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

These pseudo-elements let you style the track (the gutter), the thumb (the draggable part), the corner (where horizontal and vertical scrollbars meet), and even the buttons (arrows at each end, though most modern designs hide these).

scrollbar-color & scrollbar-width

The CSS standard approach uses two properties: scrollbar-color and scrollbar-width. These are supported in Firefox and are gaining broader adoption.

💡 Tip
Always include -webkit-backdrop-filter alongside backdrop-filter for Safari support. Without the prefix, the effect is invisible to roughly 25% of mobile users.
/* Standard CSS scrollbar styling */ .container { scrollbar-color: rgba(255,255,255,0.45) transparent; scrollbar-width: thin; /* auto | thin | none */ }

The scrollbar-color property takes two values: the thumb color and the track color. scrollbar-width accepts three keywords: auto (default), thin (narrower), or none (hidden but still scrollable).

The standard properties are simpler but offer less control than the WebKit pseudo-elements — you can't separately style hover states, corners, or add border-radius to the thumb.

Cross-Browser Strategy

The recommended approach is to use both: standard properties as the baseline, with WebKit pseudo-elements for enhanced styling in supporting browsers.

⚠ Warning
On iOS Safari, backdrop-filter inside a position: fixed element can cause severe scroll performance issues. Test thoroughly on real iOS devices.
/* Base — works in Firefox */ * { scrollbar-color: rgba(255,255,255,0.45) transparent; scrollbar-width: thin; } /* Enhanced — works in Chrome, Safari, Edge */ *::-webkit-scrollbar { width: 8px; } *::-webkit-scrollbar-track { background: transparent; } *::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; } *::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

Dark Mode Scrollbars

On dark-themed sites, default scrollbars create a jarring light rectangle. The simplest fix is to declare color-scheme: dark on the root element — this tells the browser to use its native dark scrollbar variant without any custom styling:

:root { color-scheme: dark; }

For more control, use the custom scrollbar CSS shown above with semi-transparent white values. This blends naturally with any dark background color.

Overlay & Auto-Hide Scrollbars

macOS and some mobile browsers use overlay scrollbars that appear only when scrolling and float over the content. You can approximate this behavior with overflow: overlay (where supported) or by using scrollbar-width: thin with a transparent track.

To completely hide scrollbars while keeping scroll functionality, combine scrollbar-width: none with the WebKit approach:

.no-scrollbar { scrollbar-width: none; /* Firefox */ } .no-scrollbar::-webkit-scrollbar { display: none; /* Chrome, Safari, Edge */ }

Only hide scrollbars when there's another clear indication that content is scrollable (like a visible gradient fade or swipe affordance). Hidden scrollbars can create usability issues, especially for mouse users who rely on scrollbar visibility.

Custom CSS Cursors

The CSS cursor property changes the mouse pointer appearance. CSS provides dozens of built-in cursor values for different interaction types, and you can also use custom images.

Built-in Cursor Values

The most commonly used cursor values are: pointer (clickable elements), text (text selection), grab and grabbing (draggable elements), not-allowed (disabled actions), crosshair (precision selection), and wait or progress (loading states).

.draggable { cursor: grab; } .draggable:active { cursor: grabbing; } .disabled { cursor: not-allowed; opacity: 0.5; } .link { cursor: pointer; }

Browse all available cursor values interactively in the CSS Cursor Gallery.

Custom Cursor Images

You can use any image (PNG, SVG, or CUR) as a cursor. Provide a fallback keyword in case the image fails to load:

.custom-cursor { cursor: url('/cursors/custom.png') 12 12, auto; /* 12 12 = hotspot coordinates (x, y from top-left) */ }

Keep custom cursor images small (32×32px or smaller) for best performance and compatibility. Always provide the hotspot coordinates so clicks register at the expected point. And always include a fallback keyword — without it, the cursor may disappear entirely if the image fails.

Performance Considerations

Custom scrollbar styles are painted by the browser's compositor and have negligible performance impact. Custom cursor images are cached after the first load. Neither technique should cause any measurable performance issues in production.

The main risk is usability, not performance. Extremely thin or transparent scrollbars can make content harder to navigate for users who rely on scrollbar interaction. Custom cursors that don't match the expected interaction type (like using a pointer cursor on non-clickable text) create confusion. Keep accessibility in mind when customizing UI chrome.

Customize scrollbars & cursors

Design scrollbars visually and explore all CSS cursor values with our free tools.

⚡ Scrollbar Styler🖱️ Cursor Gallery
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.
📚 References & Further Reading