coderef

scrollbar-widthBaseline · Newly available

The scrollbar-width CSS property sets the width of the scrollbar.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Dec 11, 2024.

Browser support

DesktopChrome
1–120Not supported
121+Supportedsince Jan 23, 2024
Current: 155
Edge
12–120Not supported
121+Supportedsince Jan 25, 2024
Current: 154
Firefox
1–63Not supported
64+Supportedsince Dec 11, 2018
Current: 157
Safari
1–18.1Not supported
18.2+Supportedsince Dec 11, 2024
Current: 27
MobileChrome Android
18–120Not supported
121+Supportedsince Jan 23, 2024
Current: 155
Firefox Android
4–63Not supported
64+Supportedsince Dec 11, 2018
Current: 157
Safari iOS
1–18.1Not supported
18.2+Supportedsince Dec 11, 2024
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Dec 11, 2024. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

Full syntax and examples are on MDN: scrollbar-width.

Feature detection

CSS · check before using
@supports (scrollbar-width: initial) {
  /* styles that rely on scrollbar-width */
}

/* or in JavaScript */
if (CSS.supports("scrollbar-width", "initial")) {
  // use it
}

Sub-features

Support for each part of the feature (4). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
scrollbar-width1211216418.21216418.2
scrollbar-width.auto1211216418.21216418.2
scrollbar-width.none1211216418.21216418.2
scrollbar-width.thin1211216418.21216418.2