Last active
December 12, 2024 22:38
-
-
Save spemer/a0e218bbb45433bd611e68446523a00b to your computer and use it in GitHub Desktop.
✨ Customize website's scrollbar like Mac OS. Not supports in Firefox and IE.
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
/* Customize website's scrollbar like Mac OS | |
Not supports in Firefox and IE */ | |
/* total width */ | |
body::-webkit-scrollbar { | |
background-color: #fff; | |
width: 16px; | |
} | |
/* background of the scrollbar except button or resizer */ | |
body::-webkit-scrollbar-track { | |
background-color: #fff; | |
} | |
/* scrollbar itself */ | |
body::-webkit-scrollbar-thumb { | |
background-color: #babac0; | |
border-radius: 16px; | |
border: 4px solid #fff; | |
} | |
/* set button(top and bottom of the scrollbar) */ | |
body::-webkit-scrollbar-button { | |
display:none; | |
} |
@zhnoah , you should use scrollbar-gutter: stable
instead of overflow: overlay
Perfect, thanks mate!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Chrome 114, overflow: overlay is removed.