Created
August 11, 2022 14:36
-
-
Save MichaelDimmitt/950b780825377d718896217a8e53822f to your computer and use it in GitHub Desktop.
scrollbar with css that has scroll: overlay enabled
This file contains hidden or 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
/* logic for scrollbar: */ | |
html { | |
overflow: overlay; | |
} | |
::-webkit-scrollbar { | |
width: 18px; | |
height: 18px | |
} | |
::-webkit-scrollbar-thumb { | |
border: 6px solid transparent; | |
background: rgba(0, 0, 0, .2); | |
background: var(--palette-black-alpha-20, rgba(0, 0, 0, .2)); | |
border-radius: 10px; | |
background-clip: padding-box | |
} | |
::-webkit-scrollbar-corner { | |
background: transparent | |
} | |
::-webkit-scrollbar-thumb:vertical { | |
min-height: 30px | |
} | |
::-webkit-scrollbar-thumb:horizontal { | |
min-width: 30px | |
} | |
:hover::-webkit-scrollbar-thumb { | |
background: rgba(0, 0, 0, .2); | |
background: var(--palette-black-alpha-20, rgba(0, 0, 0, .2)); | |
background-clip: padding-box | |
} | |
::-webkit-scrollbar-thumb:hover { | |
background: rgba(0, 0, 0, .3); | |
background: var(--palette-black-alpha-30, rgba(0, 0, 0, .3)); | |
background-clip: padding-box; | |
border: 4px solid transparent | |
} | |
/* https://stackoverflow.com/a/34503125/5283424 */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment