Last active
September 4, 2020 06:35
-
-
Save joellesenne/37b0a0f2054c870708d215f8245000d8 to your computer and use it in GitHub Desktop.
CSS Opacity SASS MIxin For IE, FireFox, Chrome and Safari
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
// CSS Opacity SASS MIxin For IE, FireFox, Chrome and Safari <https://coderwall.com/p/mca5xw/sass-opacity-mixin> | |
@mixin Opacity($value){ | |
$IEValue: $value*100; | |
opacity: $value; | |
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity="+$IEValue+")"; | |
filter: alpha(opacity=$IEValue); | |
} | |
/* How to use | |
img.preload{ | |
@include Opacity(0); | |
&.complete{ | |
@include Opacity(1); | |
} | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment