Skip to content

Instantly share code, notes, and snippets.

@joellesenne
Last active September 4, 2020 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joellesenne/37b0a0f2054c870708d215f8245000d8 to your computer and use it in GitHub Desktop.
Save joellesenne/37b0a0f2054c870708d215f8245000d8 to your computer and use it in GitHub Desktop.
CSS Opacity SASS MIxin For IE, FireFox, Chrome and Safari
// 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