Does LESScss convert all rgba colors to hex values?
I am trying to create a mixin, say, .color, that allows you to pass in a color variable previously defined, and I wan
You don't need to convert to hsla either so you won't need a white value
.hexBackgroundToRGBA(@color,@alpha){
@myred:red(@color);
@mygreen:green(@color);
@myblue:blue(@color);
background-color: @color;
background-color: rgba(@myred,@mygreen,@myblue,@alpha);
}
You'll have to write a few of these mixins in you need to set stuff other than the background-color property set but that's the idea. Just call it like this:
#selector{ .hexBackgroundToRGBA(@gray, 0.8); }
That will take whatever color val you have in the @gray variable and output a cross browser solution at 80% transparency with a solid color fallback for browsers that don't support rgba().