Updated Less: fixed loops in rotated-fixed.less, minor code formatting changes.

This commit is contained in:
Macdonald, Zak 2015-06-28 21:31:26 -07:00
parent 5213cd9225
commit c194cfe357
8 changed files with 21 additions and 41 deletions

12
css/font-awesome.css vendored
View File

@ -178,18 +178,6 @@
-ms-transform: scale(1, -1);
transform: scale(1, -1);
}
:root .fa-rotate-270 {
filter: none;
}
:root .fa-rotate-180 {
filter: none;
}
:root .fa-rotate-90 {
filter: none;
}
:root .fa-rotate-0 {
filter: none;
}
.fa-stack {
position: relative;
display: inline-block;

File diff suppressed because one or more lines are too long

View File

@ -1,12 +1,12 @@
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
readers do not read off random characters that represent icons */
.createIconClasses(@iterator: 1) when(@iterator <= length(@fa-var-glyphs)) {
@fa-glyph-name: extract(extract(@fa-var-glyphs, @iterator), 1);
.createIconClasses(@i: 1) when(@i <= length(@fa-var-glyphs)) {
@fa-glyph-name: extract(extract(@fa-var-glyphs, @i), 1);
@fa-glyph-name-unquoted: ~"@{fa-glyph-name}";
.@{fa-css-prefix}-@{fa-glyph-name-unquoted}:before {
content: extract(extract(@fa-var-glyphs, @iterator), 2);
content: extract(extract(@fa-var-glyphs, @i), 2);
}
.createIconClasses((@iterator + 1));
.createIconClasses((@i + 1));
}
.createIconClasses();

View File

@ -9,6 +9,7 @@
// calculate classes and values for rotation
.calculateRotations(@i) when (@i >= 0) {
@rotation-selector: ~"@{fa-css-prefix}-rotate-@{i}";
.@{rotation-selector} when (mod(@i, @fa-rotation-increment) = 0) {
.fa-icon-rotate(@i);
}
@ -26,13 +27,14 @@
// this loop
:root {
.calculateIEFixes(@i) when (@i >= 0) {
@rotation-selector: ~"@{fa-css-prefix}-rotate-@{i}";
.calculateIEFixes(@i) when (@i <= 0) {
@rotation-selector: ~"@{wi-css-prefix}-rotate-@{i}";
// check if this item needs some ie love
.@{rotation-selector} when (mod(@i, 90) = 0) {
filter: none;
}
// iterate
.calculateIEFixes((@i - 1));
.calculateIEFixes((@i + 1));
}
.calculateIEFixes(359);
}

View File

@ -3,34 +3,28 @@
// scale icon size by n
.createIconScales(@iterator: 1) when(@iterator <= length(@fa-var-scales)) {
@fa-icon-scale-name: extract(extract(@fa-var-scales, @iterator), 1);
@fa-icon-scale-name-unquoted: ~"@{fa-icon-scale-name}";
@fa-icon-scale: extract(extract(@fa-var-scales, @iterator), 2);
.@{fa-css-prefix}-@{fa-icon-scale-name-unquoted} {
font-size: floor(@fa-font-size-base * @fa-icon-scale);
line-height: floor(@fa-font-size-base * @fa-icon-scale * 0.75);
vertical-align: -15%;
}
.createIconScales((@iterator + 1));
}
.createIconScales();
// multiply icon size by n
.createIconMultipliers(@iterator: 1) when(@iterator <= length(@fa-var-multipliers)) {
@fa-icon-multiplier-name: extract(extract(@fa-var-multipliers, @iterator), 1);
@fa-icon-multiplier-name-unquoted: ~"@{fa-icon-multiplier-name}";
@fa-icon-multiplier: extract(extract(@fa-var-multipliers, @iterator), 2);
.@{fa-css-prefix}-@{fa-icon-multiplier-name-unquoted} {
font-size: floor(@fa-font-size-base * @fa-icon-multiplier);
}
.createIconMultipliers((@iterator + 1));
}
.createIconMultipliers();

View File

@ -4,12 +4,12 @@
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
readers do not read off random characters that represent icons */
.createIconClasses(@iterator: 1) when(@iterator <= length(@fa-var-glyphs)) {
@fa-glyph-name: extract(extract(@fa-var-glyphs, @iterator), 1);
.createIconClasses(@i: 1) when(@i <= length(@fa-var-glyphs)) {
@fa-glyph-name: extract(extract(@fa-var-glyphs, @i), 1);
@fa-glyph-name-unquoted: ~"@{fa-glyph-name}";
.@{fa-css-prefix}-@{fa-glyph-name-unquoted}:before {
content: extract(extract(@fa-var-glyphs, @iterator), 2);
content: extract(extract(@fa-var-glyphs, @i), 2);
}
.createIconClasses((@iterator + 1));
.createIconClasses((@i + 1));
}
.createIconClasses();

View File

@ -12,6 +12,7 @@
// calculate classes and values for rotation
.calculateRotations(@i) when (@i >= 0) {
@rotation-selector: ~"@{fa-css-prefix}-rotate-@{i}";
.@{rotation-selector} when (mod(@i, @fa-rotation-increment) = 0) {
.fa-icon-rotate(@i);
}
@ -29,13 +30,14 @@
// this loop
:root {
.calculateIEFixes(@i) when (@i >= 0) {
@rotation-selector: ~"@{fa-css-prefix}-rotate-@{i}";
.calculateIEFixes(@i) when (@i <= 0) {
@rotation-selector: ~"@{wi-css-prefix}-rotate-@{i}";
// check if this item needs some ie love
.@{rotation-selector} when (mod(@i, 90) = 0) {
filter: none;
}
// iterate
.calculateIEFixes((@i - 1));
.calculateIEFixes((@i + 1));
}
.calculateIEFixes(359);
}

View File

@ -6,34 +6,28 @@
// scale icon size by n
.createIconScales(@iterator: 1) when(@iterator <= length(@fa-var-scales)) {
@fa-icon-scale-name: extract(extract(@fa-var-scales, @iterator), 1);
@fa-icon-scale-name-unquoted: ~"@{fa-icon-scale-name}";
@fa-icon-scale: extract(extract(@fa-var-scales, @iterator), 2);
.@{fa-css-prefix}-@{fa-icon-scale-name-unquoted} {
font-size: floor(@fa-font-size-base * @fa-icon-scale);
line-height: floor(@fa-font-size-base * @fa-icon-scale * 0.75);
vertical-align: -15%;
}
.createIconScales((@iterator + 1));
}
.createIconScales();
// multiply icon size by n
.createIconMultipliers(@iterator: 1) when(@iterator <= length(@fa-var-multipliers)) {
@fa-icon-multiplier-name: extract(extract(@fa-var-multipliers, @iterator), 1);
@fa-icon-multiplier-name-unquoted: ~"@{fa-icon-multiplier-name}";
@fa-icon-multiplier: extract(extract(@fa-var-multipliers, @iterator), 2);
.@{fa-css-prefix}-@{fa-icon-multiplier-name-unquoted} {
font-size: floor(@fa-font-size-base * @fa-icon-multiplier);
}
.createIconMultipliers((@iterator + 1));
}
.createIconMultipliers();