2015-06-09 15:21:44 +08:00
|
|
|
// Compatibility for browsers.
|
|
|
|
|
|
|
|
// rotate for ie8 and blow
|
|
|
|
.ie-rotate(@rotation) {
|
2016-02-05 00:41:41 +08:00
|
|
|
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})";
|
2015-07-20 11:46:48 +08:00
|
|
|
}
|
|
|
|
|
2015-08-17 12:27:03 +08:00
|
|
|
// rotate for ie8 and blow
|
|
|
|
// degrees unit
|
|
|
|
.ie-rotate-via-degrees(@degrees) {
|
2015-07-20 17:06:19 +08:00
|
|
|
/* IE6-IE8 */
|
|
|
|
@radians: ~`parseInt("@{degrees}") * Math.PI * 2 / 360`;
|
|
|
|
@costheta: ~`Math.cos("@{radians}")`;
|
|
|
|
@sintheta: ~`Math.sin("@{radians}")`;
|
|
|
|
@negsintheta: ~`"@{sintheta}" * -1`;
|
2016-02-05 00:41:41 +08:00
|
|
|
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=@{costheta}, M12=@{negsintheta}, M21=@{sintheta}, M22=@{costheta})";
|
2015-07-20 17:06:19 +08:00
|
|
|
zoom: 1;
|
2015-08-18 13:40:38 +08:00
|
|
|
|
|
|
|
:root & {
|
|
|
|
filter: none;
|
|
|
|
}
|
2015-07-20 12:03:01 +08:00
|
|
|
}
|
|
|
|
|
2015-08-17 12:27:03 +08:00
|
|
|
// support rotate for all browsers
|
|
|
|
.cross-rotate(@degrees) {
|
|
|
|
.rotate(@degrees);
|
|
|
|
.ie-rotate-via-degrees(@degrees);
|
|
|
|
}
|
|
|
|
|
2015-07-20 11:46:48 +08:00
|
|
|
// for iconfont font size
|
|
|
|
// fix chrome 12px bug, support ie
|
2015-08-17 12:27:03 +08:00
|
|
|
.iconfont-size-under-12px(@size, @rotate: 0deg) {
|
2015-07-20 15:32:47 +08:00
|
|
|
display: inline-block;
|
2015-08-17 12:27:03 +08:00
|
|
|
@font-scale: unit(@size/@font-size-base);
|
2015-12-16 22:24:24 +08:00
|
|
|
font-size: @font-size-base;
|
2015-08-17 12:27:03 +08:00
|
|
|
font-size: ~"@{size} \9"; // ie8-9
|
|
|
|
transform: scale(@font-scale) rotate(@rotate);
|
|
|
|
.ie-rotate-via-degrees(@rotate);
|
2015-07-20 11:46:48 +08:00
|
|
|
:root & {
|
|
|
|
font-size: @font-size-base; // reset ie9 and above
|
|
|
|
}
|
|
|
|
}
|