Finalized rotate/flip in [less].

pull/82/head
Macdonald, Zak 9 years ago
parent 0ea9a37ec3
commit 823c76fe49

@ -4,7 +4,7 @@
.fa-icon() {
display: inline-block;
font: normal normal normal @wi-font-size-base / 1 WeatherIcons; // shortening font declaration
font: normal normal normal @wi-font-size-base/1 WeatherIcons; // shortening font declaration
font-size: inherit; // can't have font-size inherit on line above, so need to override
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
@ -12,11 +12,16 @@
transform: translate(0, 0); // ensures no half-pixel rendering in firefox
}
.wi-icon-rotate(@degrees, @rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation);
-webkit-transform: rotate(@degrees);
-ms-transform: rotate(@degrees);
transform: rotate(@degrees);
.wi-icon-rotate(@degrees) {
& when (mod(@degrees, 90) = 0) {
@rotation: @degrees / 90;
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation);
}
-webkit-transform: rotate(~"@{degrees}deg");
-ms-transform: rotate(~"@{degrees}deg");
transform: rotate(~"@{degrees}deg");
}
.wi-icon-flip(@horiz, @vert, @rotation) {

@ -1,2 +1,47 @@
// rotated and flipped icons
// -------------------------
@rotations-requiring-ie-fix:
"flip-horizontal",
"flip-vertical";
@z: '';
.calculateRotations(@i) when (@i >= 0) {
// iterate
.calculateRotations((@i - 1));
@z: ~"@{wi-css-prefix}-rotate-@{i}";
.@{z} when (mod(@i, @wi-rotate-by) = 0) {
.wi-icon-rotate(@i);
}
}
.calculateRotations(359);
.@{wi-css-prefix}-flip-horizontal { .wi-icon-flip(-1, 1, 0); }
.@{wi-css-prefix}-flip-vertical { .wi-icon-flip(1, -1, 2); }
// ie 8-9 fix
// -------------------------
// todo: check on assigning an array of selectors to the selector instead of this
// unnecessary duplication of code
:root {
.calculateIEFixes(@i) when (@i >= 0) {
// iterate
.calculateIEFixes((@i - 1));
@z: ~"@{wi-css-prefix}-rotate-@{i}";
.@{z} when (mod(@i, 90) = 0) {
filter: none;
}
}
.calculateIEFixes(359);
}

Loading…
Cancel
Save