Skip to content

Instantly share code, notes, and snippets.

@bwindels
Created November 6, 2018 14:12
Show Gist options
  • Save bwindels/757afcece6d32b657c3d350eb6b35bdd to your computer and use it in GitHub Desktop.
Save bwindels/757afcece6d32b657c3d350eb6b35bdd to your computer and use it in GitHub Desktop.
scroll gradient indicator
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
body {
background: #F2F5F8;
font: 120% sans-serif;
}
.scrollbox {
overflow: auto;
width: 200px;
max-height: 200px;
margin: 50px auto;
background:
/* Shadow covers */
linear-gradient(#F2F5F8, transparent),
linear-gradient(transparent, #F2F5F8);
background-repeat: no-repeat;
background-size: 100% 40px, 100% 40px;
background-position: top, bottom;
/* Opera doesn't support this in the shorthand */
background-attachment: scroll, scroll;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment