I'm working on a bulletproof Mixin LESS file and i have a problem with the "rotate" property for IE8 and below.
According to this post, to rotate an element on IE you have to use the following property:
filter: progid:DXImageTransform.Microsoft.Matrix(
M11 = COS_THETA,
M12 = -SIN_THETA,
M21 = SIN_THETA,
M22 = COS_THETA,
sizingMethod = 'auto expand'
);
Where COS_THETA and SIN_THETA are the cosine and sine values of the angle.
I wrote the following code in LESS but it seems that it doesn't work.
.rotate(@degrees: 45deg) {
-webkit-transform: rotate(@degrees);
-moz-transform: rotate(@degrees);
-ms-transform: rotate(@degrees);
-o-transform: rotate(@degrees);
transform: rotate(@degrees);
@cos: cos(@degrees);
@sin: sin(@degrees);
/* IE8- */
filter: progid:DXImageTransform.Microsoft.Matrix(
M11=@cos,
M12=-@sin,
M21=@sin,
M22=@cos,
sizingMethod='auto expand'
);
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(
M11=@{cos},
M12=-@{sin},
M21=@{sin},
M22=@{cos},
SizingMethod = 'auto expand'
)";
}
Have any idea what am I doing wrong? Or have you other suggestions on improving this mixing?
Thank you!