Skip to content

Instantly share code, notes, and snippets.

@name-k
Forked from anonymous/gist:4169726
Last active December 19, 2015 08:59
Show Gist options
  • Save name-k/5929456 to your computer and use it in GitHub Desktop.
Save name-k/5929456 to your computer and use it in GitHub Desktop.
.rgba(@colour, @alpha) {
@alphaColour: hsla(hue(@colour), saturation(@colour), lightness(@colour), @alpha);
@ieAlphaColour: argb(@alphaColour);
background-color: @colour; // Fallback for older browsers
// IE hacks
zoom: 1; // hasLayout
background-color: transparent\9;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=@{ieAlphaColour}, endColorstr=@{ieAlphaColour})"; // IE 8+
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr=@{ieAlphaColour}, endColorstr=@{ieAlphaColour})"; // IE 6 & 7
background-color: @alphaColour;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment