I am using LESSCSS. I\'m trying to create a method for opacity:
.opacity (@opacity)
{
opacity: @opacity;
-ms-filter: \"progid:DXImageTransform.Microsof
In dotless, do this. (I would NOT recommend script tags - they are ugly, language specific and not supported by dotless).
.opacity (@opacity) {
@opacityPercentage: @opacity * 100;
opacity: @opacity;
-ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=(@{opacityPercentage}))";
filter: ~"alpha(opacity = (@{opacityPercentage}))";
}
in dotless 1.2.3 (when it is released in a couple of weeks, or github head, you should be able to do this...
.opacity (@opacity) {
@opacityPercentage: @opacity * 100;
opacity: @opacity;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(opacity=(@opacityPercentage));
filter: alpha(opacity = (@opacityPercentage));
}
and re: the comment from Mathletics, dotless is not "the worst compiler".. It matches less.js up to 1.1.5, soon to be 1.2.2 and many of the 600 bugs against less.js are fixed in dotless. You may have used dotless over 8 months ago, but things change and bugs are fixed... dotless also has better support for comments and variable scoping.