Skip to content

Instantly share code, notes, and snippets.

@litopia
Created February 3, 2016 21:35
Show Gist options
  • Save litopia/a1453cfde925408b31a9 to your computer and use it in GitHub Desktop.
Save litopia/a1453cfde925408b31a9 to your computer and use it in GitHub Desktop.
Fix scrolling performance with CSS will-change property (background-attachment: css)
.fixed-background-container
background: transparent
color: $white
&:before
content: ''
position: fixed
height: 100%
width: 100%
top: 0
left: 0
background-color: white
background: url("/path/to/img") no-repeat center center
background-size: cover
will-change: tranform
z-index: -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment