Skip to content

Instantly share code, notes, and snippets.

@quattromani
Created June 12, 2014 00:22
Show Gist options
  • Save quattromani/f06f9e542683ea94fe2d to your computer and use it in GitHub Desktop.
Save quattromani/f06f9e542683ea94fe2d to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="neat-background box">
I'm have a transparent background y'all
</div>
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
// RGBA w/Fallback
@mixin rgba($color, $alpha) {
$rgba: rgba($color, $alpha);
$ie-hex-str: ie-hex-str($rgba);
background: $rgba;
.ie & {
background: transparent;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie-hex-str}, endColorstr=#{$ie-hex-str})";
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie-hex-str},endColorstr=#{$ie-hex-str});
zoom: 1
}
}
// Use it like this
.neat-background {
@include rgba(#333,.5);
}
.neat-background {
background: rgba(51, 51, 51, 0.5);
}
.ie .neat-background {
background: transparent;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#80333333, endColorstr=#80333333)";
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#80333333,endColorstr=#80333333);
zoom: 1;
}
<div class="neat-background box">
I'm have a transparent background y'all
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment