Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have dark mode scrollbars?

I want to get my scrollbar dark mode as well (exactly like Github does for example). Referring to this answer, using the css color-scheme works but as stated, it messes up the inputs and form-controls.

Is there a way to use this class but not let it override input and form-control? Or perhaps there are better ways to have dark scrollbars without defining a custom scrollbar from scratch.

like image 894
The White Wolf Avatar asked Oct 31 '25 15:10

The White Wolf


1 Answers

You could create a div which contains the scrollbar only and apply color-scheme: dark; style, or you could use body::webkit-scrollbar styling to create a custom scrollbar entirely, last I can think of is you could manually redefine the styling you do not want color-scheme to change.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!