Skip to content

Instantly share code, notes, and snippets.

@SaraSoueidan
Created July 26, 2013 18:18
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SaraSoueidan/6091046 to your computer and use it in GitHub Desktop.
Save SaraSoueidan/6091046 to your computer and use it in GitHub Desktop.
Sass mixin for styling scrollbars in webkit by Hugo Giraudel (http://codepen.io/HugoGiraudel/pen/KFDuB)
/**
* Mixin scrollbar
*/
@mixin scrollbar($size, $primary, $secondary: lighten($primary, 25%)) {
::-webkit-scrollbar {
width: $size;
height: $size;
}
::-webkit-scrollbar-thumb {
background: $primary;
}
::-webkit-scrollbar-track {
background: $secondary;
}
// For Internet Explorer
body {
scrollbar-face-color: $primary;
scrollbar-track-color: $secondary;
}
}
/**
* Call the damn thing
*/
@include scrollbar(.5em, tomato);
/**
* Force scrollbars
*/
body {
height: 3000px;
width: 3000px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment