Created
March 30, 2016 14:50
-
-
Save fotan/472aa1f7b0a2f5439a3e8fa83307282b to your computer and use it in GitHub Desktop.
SCSS - Opacity
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
/// Given an opacity value, generates that value as well as a way to display that opacity value in Internet Explorer 8 and 9. | |
/// @access public | |
/// @param {Float} $opacity - Opacity | |
/// @example scss - Usage | |
/// .foo { | |
/// @include opacity(0.5); | |
/// } | |
/// @example css - Result | |
/// .foo { | |
/// opacity: 0.5; | |
/// filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=#50)"; | |
/// } | |
@mixin opacity($opacity) { | |
opacity: $opacity; | |
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=#{$opacity * 100})"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment