Skip to content

Instantly share code, notes, and snippets.

@imlinus
Last active December 29, 2015 10:19
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 imlinus/7656416 to your computer and use it in GitHub Desktop.
Save imlinus/7656416 to your computer and use it in GitHub Desktop.
Alpha mixin
@mixin alpha($val: 0) {
$ie-alpha: $val * 100;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=#{$ie-alpha})";
filter: alpha(opacity=#{$ie-alpha});
@include prefix(opacity, $val);
}
%alpha-0 { @include alpha(0); }
%alpha-50 { @include alpha(0.5); }
%alpha-100 { @include alpha(1); }
// usage
.element {
@include alpha(0.5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment