Created
May 27, 2022 07:58
-
-
Save maximLyakhov/d4121cdf4cf271173d66f9f6f4c6d2f8 to your computer and use it in GitHub Desktop.
scrollbar styling
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
@mixin scrollbars($size, $foreground-color, $background-color: mix($foreground-color, white, 50%)) { | |
// For Google Chrome | |
&::-webkit-scrollbar { | |
width: $size; | |
height: $size; | |
} | |
&::-webkit-scrollbar-thumb { | |
background: $foreground-color; | |
} | |
&::-webkit-scrollbar-track { | |
background: $background-color; | |
} | |
// For Internet Explorer | |
& { | |
scrollbar-face-color: $foreground-color; | |
scrollbar-track-color: $background-color; | |
} | |
} | |
/* Usage: */ | |
body { | |
@include scrollbars(10px, pink, red); | |
} | |
.custom-area { | |
@include scrollbars(.5em, slategray); | |
} | |
/* https://css-tricks.com/snippets/sass/custom-scrollbars-mixin/ */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment