Created
May 27, 2020 04:32
-
-
Save M-O-Z-G/c7d3821213ae45b42874130024be4a38 to your computer and use it in GitHub Desktop.
Custom scrollbar Stylus mixin for Google Chrome and Mozilla Firefox 64+.
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
$scrollbar-width= 5px | |
$scrollbar-color= red | |
$scrollbar-background= transparent | |
$scrollbar-thumb-radius= 6px | |
$scrollbar-thumb-border-thickness= 0px | |
scrollbar() | |
scrollbar-width: thin | |
scrollbar-color: transparent transparent | |
transition: scrollbar-color 300ms | |
&::-webkit-scrollbar | |
width: $scrollbar-width; | |
&::-webkit-scrollbar-track | |
background: transparent | |
&::-webkit-scrollbar-thumb | |
background-color: transparent | |
border-radius: $scrollbar-thumb-radius; | |
border: $scrollbar-thumb-border-thickness solid transparent | |
&:hover | |
scrollbar-color: $scrollbar-color $scrollbar-background | |
&::-webkit-scrollbar-thumb | |
background-color: $scrollbar-color | |
border: $scrollbar-thumb-border-thickness solid $scrollbar-background | |
&::-webkit-scrollbar-track | |
background: $scrollbar-background | |
$scrollbar | |
scrollbar() | |
.foo | |
@extend $scrollbar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment