How to Inspect and Override CSS scrollbar-width in Google Chrome DevTools

Modern web applications frequently customise interface typography, form controls, and scrollable containers to match brand design aesthetics. While the CSS scrollbar-width property is widely supported across modern browsers to toggle between default, compact, and invisible scrollbars without breaking scrolling behaviour, developers must carefully inspect and test how these rules render across desktop operating systems. Google Chrome DevTools provides robust inspection and real-time override tools to test scrollbar-width across varying viewports.

Understanding the CSS scrollbar-width Property

Historically, web developers had to rely on vendor-prefixed pseudo-elements (such as ::-webkit-scrollbar) to adjust scrollbar dimensions. The CSS Box Alignment and CSS Scrollbars standards introduced scrollbar-width as the official, standard property for controlling scrollbar thickness:

  • auto: (Default) The user agent’s default scrollbar width, typically 15–17 pixels on Windows and Linux systems.
  • thin: Renders a narrower, minimalist scrollbar track and thumb, ideal for tight sidebar menus, code blocks, or embedded modal windows.
  • none: Completely hides the scrollbar track and thumb while leaving the container fully scrollable via mouse wheel, trackpad gestures, or keyboard arrow keys.

Opening Chrome DevTools and Inspecting Scrollable Nodes

To inspect scrollbar dimensions on an active web page:

  1. Open Google Chrome and navigate to the application or webpage.
  2. Press F12 or Ctrl + Shift + I (Windows/Linux) or Cmd + Option + I (macOS) to launch Chrome DevTools.
  3. Select the Elements panel.
  4. Use the Inspect Cursor (Ctrl + Shift + C) to click directly on your scrollable container or sidebar.
  5. Examine the Styles pane on the right-hand side.

Testing scrollbar-width Overrides in Real Time

DevTools allows you to inject or toggle scrollbar-width declarations interactively:

  1. With the target container selected in the DOM tree, locate the active CSS rule block or click the + (New Style Rule) icon in the Styles pane.
  2. Type:
    scrollbar-width: thin;
  3. Observe how the container’s scrollbar immediately contracts into a streamlined track, freeing up horizontal content space.
  4. Next, test complete scrollbar concealment:
    scrollbar-width: none;
  5. Verify that the scrollbar vanishes entirely, but scrolling remains operational when scrolling with the mouse wheel or touch gestures.

Checking Computed Inheritance and Browser Fallbacks

Because scrollbar styling inherits down the DOM tree, checking effective values prevents unexpected formatting bugs:

  1. Click the Computed tab in the right-hand panel.
  2. Search for scrollbar-width to verify whether parent elements (such as html or body) are overriding your container styles.
  3. Inspect the stylesheet origin link to verify whether framework CSS (such as Tailwind or Bootstrap) is applying conflicting overflow or legacy WebKit rules.

Pairing scrollbar-width with scrollbar-color

To deliver a cohesive theme across dark and light modes, pair scrollbar-width with scrollbar-color:

.custom-scroll {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.5) transparent;
}

Testing these standard rules in Google Chrome DevTools ensures reliable, accessible, and standards-compliant scrolling performance across all operating systems without relying on brittle legacy hacks.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.