Created
August 12, 2011 05:10
-
-
Save jmblog/1141499 to your computer and use it in GitHub Desktop.
linear-gradient.scss
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
$css3-ie-support: 0 !default; | |
@mixin linear-gradient($topColor, $bottomColor) { | |
background-image: -moz-linear-gradient(top, $topColor, $bottomColor); | |
background-image: -webkit-gradient(linear, left top, left bottom, from($topColor), to($bottomColor)); | |
// If you set the output style as "compressed", it doesn't work well... | |
@if $css3-ie-support == 1 { | |
$ieTopColor: rgb(red($topColor), green($topColor), blue($topColor)); | |
$ieBottomColor: rgb(red($bottomColor), green($bottomColor), blue($bottomColor)); | |
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#{$ieTopColor}', endColorstr='#{$ieBottomColor}'); // IE6 & IE7 | |
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#{$ieTopColor}', endColorstr='#{$ieBottomColor}')"; // IE8 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment