Created
June 25, 2013 18:48
-
-
Save rheaton/5861191 to your computer and use it in GitHub Desktop.
background-size mixin using IE8 polyfill
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
@mixin ftm-background-size($background-size-value: contain, $background-size-value-y: 100%) { | |
$cover-or-contain: ($background-size-value == contain) or ($background-size-value == cover); | |
@if $cover-or-contain { | |
background-size: $background-size-value; | |
-webkit-background-size: $background-size-value;/* Safari 3.0 */ | |
-moz-background-size: $background-size-value; /* Gecko 1.9.2 (Firefox 3.6) */ | |
-o-background-size: $background-size-value; /* Opera 9.5 */ | |
} @else { | |
background-size: $background-size-value $background-size-value-y; | |
-webkit-background-size: $background-size-value $background-size-value-y;/* Safari 3.0 */ | |
-moz-background-size: $background-size-value $background-size-value-y; /* Gecko 1.9.2 (Firefox 3.6) */ | |
-o-background-size: $background-size-value $background-size-value-y; /* Opera 9.5 */ | |
} | |
-ms-behavior: url(/assets/background_size/backgroundsize.htc); | |
// add support for IE8 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment