Last active
December 14, 2015 07:18
-
-
Save jensgro/5049331 to your computer and use it in GitHub Desktop.
Converts a solid color with an alpha-channel-value into rgba and an IE-filter as fallback for oldIE (IE up to version 8).
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
// Converts a solid color with an alpha-channel-value into rgba | |
// and an IE-filter as fallback for oldIE (IE up to version 8) | |
@mixin all-rgba($color, $alpha) { | |
$rgba: rgba($color, $alpha); | |
$ie-color: ie-hex-str($rgba); | |
background-color: $color; | |
background-color: $rgba; | |
/* for oldIE */ | |
*background-color: transparent; | |
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr='#{$ie-color}', EndColorStr='#{$ie-color}'); | |
zoom: 1; | |
} |
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
.test { | |
@include all-rgba(rgb(162,0,0),0.2); | |
} |
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
.test { | |
background-color: #a20000; | |
background-color: rgba(162, 0, 0, 0.2); | |
/* for oldIE */ | |
*background-color: transparent; | |
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr='#33A20000', EndColorStr='#33A20000'); | |
zoom: 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment