I’ve been trying to figure out how to escape, concatenate, and/or interpolate strings in the .NET port of Less CSS, dotLess.   dotLess does not support the same escape, concatenation, or interpolation syntax as Less.js.  Unfortunately, this information has been conspicuously missing from the documentation.  Moreover, there are not clear examples or explanations of what is supported in 3 of the 4 threads I found.

Here are straightforward examples of exactly how you can interpolate (or concatenate) strings in the dotLess, the .NET port of Less CSS.

Example 1 of String Interpolation/Concatenation in dotLess

This example dotLess mixin uses IE’s proprietary CSS filter property to get a cross-browser text shadow.  When dotLess processes through it, the variables need to be replaced to get the correct syntax.  This is the only way I have found to concatenate strings / interpolate strings in dotLess (the .NET port of Less CSS).

.textshadow(@x, @y, @blur, @color){
text-shadow:formatString("{0}px {1}px {2}px {3}", @x, @y, @blur, @color);
filter:formatString("progid:DXImageTransform.Microsoft.DropShadow(OffX={0}, OffY={1}, Color='{3}') progid:DXImageTransform.Microsoft.Blur(pixelradius={2})", @x, @y, @blur, @color);
}

Example 2 of String Interpolation/Concatenation in dotLess

This example dotLess mixin uses IE’s proprietary CSS filter property to get a cross-browser linear gradient. When dotLess processes through it, the variables need to be replaced to get the correct syntax.  This is the only way I have found to concatenate strings / interpolate strings in dotLess (the .NET port of Less CSS).

.simple-gradient(@startColor, @endColor){
/* http://www.colorzilla.com/gradient-editor/ */
background:formatString("-moz-linear-gradient(top, {0} 0%, {1} 100%)", @startColor, @endColor);
background:formatString("-webkit-gradient(linear, left top, left bottom, color-stop(0%,{0}), color-stop(100%,{1}))", @startColor, @endColor);
background:formatString("-webkit-linear-gradient(top, {0} 0%,{1} 100%)", @startColor, @endColor);
background:formatString("-o-linear-gradient(top, {0} 0%,{1} 100%)", @startColor, @endColor);
filter:formatString("progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr={0},endColorstr={1})", @startColor, @endColor);
background:formatString("-ms-linear-gradient(top, {0} 0%,{1} 100%)", @startColor, @endColor);
background:formatString("linear-gradient(top, {0} 0%,{1} 100%)", @startColor, @endColor);
}

Example 3 of escaping a string in dotLess

This example dotLess code uses IE’s proprietary CSS expression function to fake support for the inherit keyword. When dotLess processes through it, the the proprietary syntax needs to be escaped.  This is the only way I have found to escape strings in dotLess (the .NET port of Less CSS).

*color:formatString("expression(this.parentNode.currentStyle['color'])");