Last active
December 29, 2015 10:19
-
-
Save imlinus/7656416 to your computer and use it in GitHub Desktop.
Alpha mixin
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
@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