Last active
August 29, 2015 14:01
-
-
Save yankeyhotel/a96e5ef7bb83af8bb670 to your computer and use it in GitHub Desktop.
Background Cover Less Mixin
This file contains 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
.background-cover(@url, @position) { | |
background-image: url(@url); | |
background-position: center @position; | |
-moz-background-size: cover; | |
background-size: cover; | |
background-repeat: no-repeat; | |
} |
This file contains 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
// How to use | |
div { | |
.background("../img/image.jpg", center); | |
} | |
// Output | |
div { | |
background-image: url("../img/image.jpg"); | |
background-position: center center; | |
-moz-background-size: cover; | |
background-size: cover; | |
background-repeat: no-repeat; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment