Styling Scrollbars with CSS: The Modern Way to Style Scrollbars

Since the early days of the web, customizing the browser’s scrollbar has proven to be very difficult to standardize across major browsers. Fortunately, on September 2018 a W3C Working Draft called CSS Scrollbars was released that looks like a viable way to finally accomplish this!

Turns out the ::-webkit-scrollbar-* pseudo selectors (which never were a standard) are no longer favored, as the CSS Scrollbars Spec allows you to define a custom scrollbar through properties:

body {
  scrollbar-width: thin;          /* "auto" or "thin"  */
  scrollbar-color: blue orange;   /* scroll thumb & track */ 
}

Currently supported in Firefox only, though.

Styling Scrollbars with CSS: The Modern Way to Style Scrollbars →
CSS Scrollbars Module Level 1 →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.