Created
October 21, 2023 18:18
-
-
Save vslipchenko/07c2ba9bbb6cf7de4cf5d43ea5d9183f to your computer and use it in GitHub Desktop.
Custom universal scrollbar for Firefox/WebKit-based browsers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Show custom scrollbar on devices with a large display (laptops, desktops, etc.) | |
as smaller devices usually have a neat scrollbar already */ | |
@media (min-width: 992px) { | |
/* Firefox */ | |
@supports (scrollbar-width: thin) { | |
* { | |
/* First collor is responsible for the thumb color, the second one - for the track color */ | |
scrollbar-color: #b9b9b9 #f0f0f0; | |
scrollbar-width: thin; | |
} | |
} | |
/* WebKit-based browsers */ | |
::-webkit-scrollbar { | |
/* It should result in a scrollbar with roughly the same width | |
as the one with scrollbar-width: thin; */ | |
width: 10px; | |
} | |
::-webkit-scrollbar-thumb { | |
background: #b9b9b9; | |
} | |
::-webkit-scrollbar-track { | |
background: #f0f0f0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment