๐Ÿ“œ CSS

Custom Scrollbars in CSS โ€” Styled, Subtle, Cross-Browser

๐Ÿ“… Jul 3, 2026 โฑ 2 min read

Default scrollbars are chunky and gray; invisible ones hurt usability. Aim for subtle.

The modern standard (Firefox + new Chrome)

* {
  scrollbar-width: thin;                       /* thin | auto | none */
  scrollbar-color: #3a3a4a transparent;        /* thumb | track */
}

The webkit fallback (older Chrome/Safari)

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #3a3a4a; border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #4a4a5e; }

Ship both โ€” browsers use whichever they understand. This site does exactly this (scroll any code block).

The layout-shift fix nobody knows

html { scrollbar-gutter: stable; }
/* reserves scrollbar space even on short pages โ€”
   content stops jumping sideways between pages */
โ† All Articles