Created
April 7, 2012 19:17
-
-
Save s9tpepper/2331484 to your computer and use it in GitHub Desktop.
Element Background Opacity w/out affecting children
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
/* The opacity: .5 CSS property will make the container and its | |
* children transparent. This LESS mixin can be used to set the | |
* background-color property with opacity resulting in a transparent | |
* background color with full opacity children. | |
*/ | |
.backgroundOpacityRGB(@red: 0, @green: 0, @blue: 0, @bgOpacity: 0.5) { | |
background: rgb(@red, @green, @blue); // Fallback to full opacity bg | |
background: rgba(@red, @green, @blue, @bgOpacity); // Alpha'd bg color for 'modern' browsers | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment