Skip to content

Instantly share code, notes, and snippets.

@tobaco
Created September 20, 2012 19:10
Show Gist options
  • Save tobaco/3757753 to your computer and use it in GitHub Desktop.
Save tobaco/3757753 to your computer and use it in GitHub Desktop.
Style Scrollbars in Webkit (example from dabblet.com)
/**
* Style scrollbars in Webkit
* Warning: nonstandard CSS ahead
*/
::-webkit-scrollbar {
width: 20px;
height: 20px;
}
section.page:not(.focus):not(:hover)::-webkit-scrollbar {
display: none;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb {
border-radius: 999px;
border: 5px solid transparent;
}
::-webkit-scrollbar-track {
box-shadow: 1px 1px 5px rgba(0,0,0,.2) inset;
}
::-webkit-scrollbar-thumb {
min-height: 20px;
background: url(/img/noise.png);
background-clip: content-box;
box-shadow: 0 0 0 5px hsla(24, 20%, 50%,.4) inset;
}
::-webkit-scrollbar-corner {
background: transparent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment