Skip to content

Instantly share code, notes, and snippets.

@mukhortov
Forked from swider/rotate.less
Last active August 29, 2015 14:15
Show Gist options
  • Save mukhortov/399f852c49b24f0cdb64 to your computer and use it in GitHub Desktop.
Save mukhortov/399f852c49b24f0cdb64 to your computer and use it in GitHub Desktop.
.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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment