Consider using the following code snippet:
.create-transparent-border (@alpha:.2, @red:0, @green:0, @blue:0, @style: solid, @thickness:1px) {
@value: @thickness @style rgba(@red, @green, @blue, @alpha);
border: @value;
}
This updated code not only functions properly but also offers a more logical structure. Contrastingly, your initial approach required passing the color as a string:
#customElement{
/*Existing, non-functional syntax*/
.create-transparent-border (0.2, "0, 0, 0", dashed, 2px);
/*Improved and functional technique */
.create-transparent-border (0.2, 0, 0, 0, dashed, 2px);
/*As these represent the default settings, it is equivalent to*/
.create-transparent-border
}
Rendered LESS code:
#customElement {
border: 1px solid rgba(0,0,0, 0.2);
}