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 →