Created
May 2, 2012 11:26
-
-
Save johnrees/2575957 to your computer and use it in GitHub Desktop.
SASS/SCSS Internet Explorer Compatible Opacity 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
@mixin opacity($alpha) { | |
// IE 8 | |
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=$alpha*100)"; | |
// IE 5-7 | |
filter: alpha(opacity=$alpha*100); | |
// Real Browsers | |
-webkit-opacity: $alpha; | |
-moz-opacity: $alpha; | |
-khtml-opacity: $alpha; | |
opacity: $alpha; | |
} | |
// 50% transparency | |
@include opacity(.5); | |
// no transparency | |
@include opacity(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment