Created
April 29, 2012 10:32
-
-
Save Daniel15/2549243 to your computer and use it in GitHub Desktop.
LESS mixin for RGBA colours in IE
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
// Use with colour name: .rgba(black, 0.5) or hex value: .rgba(#FF2400, 0.5) | |
.rgba(@colour, @alpha) | |
{ | |
@alphaColour: hsla(hue(@colour), saturation(@colour), lightness(@colour), @alpha); | |
@ieAlphaColour: argb(@alphaColour); | |
background-color: @colour; // Fallback for older browsers | |
background-color: @alphaColour; | |
// 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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment