Skip to content

Instantly share code, notes, and snippets.

@nash403
Created January 5, 2018 14:41
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nash403/42d97e1bbcf2df979dae0d2e4b0fb98e to your computer and use it in GitHub Desktop.
Save nash403/42d97e1bbcf2df979dae0d2e4b0fb98e to your computer and use it in GitHub Desktop.
Scss mixins for custom scrollbar and no scrollbar
// custom scroll-bar
@mixin custom-scroll-bar() {
&::-webkit-scrollbar {
border-radius: 10px;
height: 10px;
width: 8px;
}
&::-webkit-scrollbar-thumb {
background: #999;
border-radius: 10px;
}
&::-webkit-scrollbar-track {
border-radius: 10px;
}
}
// no scroll bar
@mixin no-scroll-bar() {
&::-webkit-scrollbar {
height: 0;
width: 0;
}
&::-webkit-scrollbar-thumb {
height: 0;
width: 0;
}
&::-webkit-scrollbar-track {
height: 0;
width: 0;
}
}
@nickimola
Copy link

Thanks

@ShenJack
Copy link

This helps a lot! Thanks :)

@Luonstreak
Copy link

thanks! it works great! :D

@patrickminero
Copy link

Thank you very much!

@ValeriaCurseri
Copy link

Thank you!

@kolkol69
Copy link

what is the purpose of setting height e.g. as 10px? Haven't notice any difference

@nash403
Copy link
Author

nash403 commented Jan 21, 2021

what is the purpose of setting height e.g. as 10px? Haven't notice any difference

@kolkol69 it is for horizontal scrolling.

@TimmyKid
Copy link

Thanks, this helps for the -webkit- versions but not the -ms- versions, while I'm also not sure about the rest. Anyway to write this out for these other browser?

@nwnshin
Copy link

nwnshin commented Oct 21, 2021

Thank you! This helped a lot

@matheusxreis
Copy link

thanks ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment