Create a gist now

Instantly share code, notes, and snippets.

image-less RGBA backgrounds for real browsers and Internet Explorer
@mixin rgba-background($color, $opacity) {
background-color: $color;
background-color: rgba($color, $opacity);
background-color: transparent\9;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{'#'+hex(round($opacity*255)) + '' + hex(red($color)) + '' + hex(green($color)) + '' + hex(blue($color))},endColorstr=#{'#'+hex(round($opacity*255)) + '' + hex(red($color)) + '' + hex(green($color)) + '' + hex(blue($color))});
zoom: 1;
}
module Sass::Script::Functions
module SassHex
def hex(decimal)
Sass::Script::String.new("%02x" % decimal)
end
end
include SassHex
end
# All you should have todo is require the sass-hex.rb file
# I use this trick a lot in compass when extending sass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment