-
-
Save ugommirikwe/5b3b9e1d273cdf7d917a to your computer and use it in GitHub Desktop.
CSS LESS Mixin for applying background color using the RGBA expression.
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
.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