4

When the website is set to dark mode, the scrollbar is not set to dark, i.e., stays light (Microsoft Edge 116.0.1938.76). The native scrollbar is set to dark, with the following code on Chrome browsers:

:root {
  color-scheme: dark;
}
4
  • 1
    Afaik, the scrollbar is managed by the browser itself. It's not something SO styles.
    – Cerbrus
    Sep 12 at 22:48
  • 2
    @Cerbrus How the browser styles it can be controlled by CSS, though. I tried the code here via dev tools in Chrome on Windows (which also shows a light scrollbar in dark mode), and it does indeed make the scrollbar dark instead of light.
    – Ryan M Mod
    Sep 13 at 0:51
  • 1
    It is true, you can. It is unnecessarily hard to do so cross-browser though. It is hardly an implemented standard at this point. color-scheme is universally implemented though, but that will affect more than only the scrollbar of course so from the perspective of the implementer it probably isn't as easy as it is stated here.
    – Gimby
    Sep 13 at 14:08
  • @Gimby color-scheme only affects native elements like date picker, scrollbar, input fields, etc. and the whole site is already custom designed to fit dark mode, so I don’t see a scenario where this code snippet would change something else that isn’t already a bug. But what do I know. SO‘s code base is probably huge and most bugs start with the sentence "it shouldn’t affect …", so SO‘s engineers need to figure this one out.
    – Sheldon
    Sep 14 at 15:23

0

You must log in to answer this question.

Browse other questions tagged .