Skip to content

Instantly share code, notes, and snippets.

@Zauberfisch
Created February 7, 2012 16:49
Show Gist options
  • Save Zauberfisch/1760690 to your computer and use it in GitHub Desktop.
Save Zauberfisch/1760690 to your computer and use it in GitHub Desktop.
[SCSS] Cross Browser alpha background colour mixin
@mixin rgba-background($color, $opacity) {
$rgba: rgba($color, $opacity);
$IEcolor: ie_hex_str($rgba);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#{$IEcolor}', endColorstr='#{$IEcolor}', GradientType=0 );
background: $rgba;
}
@Zauberfisch
Copy link
Author

usage:

.div {
    @include rgba-background(#f0f, 0.7);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment