Created
February 3, 2016 21:35
-
-
Save litopia/a1453cfde925408b31a9 to your computer and use it in GitHub Desktop.
Fix scrolling performance with CSS will-change property (background-attachment: css)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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