Created
June 24, 2023 03:36
-
-
Save 0xffan/1da9adb77964e3f5fbd7a0ad181a4822 to your computer and use it in GitHub Desktop.
自定义 Scrollbar 样式
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
html { | |
scroll-behavior: smooth; | |
} | |
/* Scrollbar size */ | |
::-webkit-scrollbar { | |
width: 10px; | |
height: 10px; | |
transition: 1.0s; | |
} | |
::-webkit-scrollbar-thumb { | |
background-color: rgba(127, 127, 127, 0.6); | |
background-clip: padding-box; | |
border: 2px solid transparent; | |
border-radius: 5px; | |
transition: 1.0s; | |
} | |
::-webkit-scrollbar-thumb:vertical:hover, | |
::-webkit-scrollbar-thumb:horizontal:hover { | |
background-color: rgb(110, 110, 110); | |
transition: 0.3s; | |
} | |
::-webkit-scrollbar-track { | |
background-color: transparent; | |
} | |
::-webkit-scrollbar-thumb:vertical:active, | |
::-webkit-scrollbar-thumb:horizontal:active { | |
background: rgba(95, 91, 91, 1); | |
} | |
::-webkit-scrollbar-corner { | |
background: none; | |
} |
Author
0xffan
commented
Jun 24, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment