Last active
March 26, 2017 21:42
-
-
Save jgv/745754 to your computer and use it in GitHub Desktop.
Cross-browser sass/scss mixin for opacity down to IE 5
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
@mixin hp-opacity($trans) { | |
filter: alpha(opactiy=($trans * 100)); | |
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=#{$trans * 100})"; | |
-moz-opacity: $trans; | |
-khtml-opacity: $trans; | |
opacity: $trans; | |
} |
Ooh, and in filter
@worthers thanks, fixed
Typo in filter 'opactiy' => 'opacity', not fixed
Also, the "filter" line should be after "-ms-filter" to support IE8 in IE7 rendering mode. Syntax issue prevents the calculation correctly for the "filter" line, should be: "filter: alpha(opacity=#{$trans * 100});"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Typo in -ms-filter Opactiy => Opacity