Skip to content

Instantly share code, notes, and snippets.

@swider
Created October 6, 2011 22:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save swider/1268926 to your computer and use it in GitHub Desktop.
Save swider/1268926 to your computer and use it in GitHub Desktop.
LESS Rotate Mixin for IE
.rotate(@val) {
-moz-transform: rotate(@val); /* FF3.5+ */
-o-transform: rotate(@val); /* Opera 10.5 */
-webkit-transform: rotate(@val); /* Saf3.1+, Chrome */
-ms-transform: rotate(@val); /* IE9 */
transform: rotate(@val);
/* IE6-IE8 */
@radians: ~`parseInt("@{val}") * Math.PI * 2 / 360`;
@costheta: ~`Math.cos("@{radians}")`;
@sintheta: ~`Math.sin("@{radians}")`;
@negsintheta: ~`"@{sintheta}" * -1`;
filter: ~"progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=@{costheta}, M12=@{negsintheta}, M21=@{sintheta}, M22=@{costheta})";
zoom: 1;
}
@dasmurphy
Copy link

I added a position fix less to your gist :) Thanks for the gist. It was my first way to the solution.

https://gist.github.com/dasmurphy/c39bc72ff51c21889f78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment