2015-06-29 11:33:26 +08:00
|
|
|
// mixins
|
2013-06-12 12:32:47 +08:00
|
|
|
// --------------------------
|
|
|
|
|
2014-08-25 00:42:24 +08:00
|
|
|
.fa-icon() {
|
|
|
|
display: inline-block;
|
2014-12-28 22:27:45 +08:00
|
|
|
font: normal normal normal @fa-font-size-base/1 FontAwesome; // shortening font declaration
|
2014-08-25 00:42:24 +08:00
|
|
|
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;
|
|
|
|
-moz-osx-font-smoothing: grayscale;
|
2015-01-21 01:56:00 +08:00
|
|
|
transform: translate(0, 0); // ensures no half-pixel rendering in firefox
|
2015-06-29 11:33:26 +08:00
|
|
|
|
2014-08-25 00:42:24 +08:00
|
|
|
}
|
|
|
|
|
Less refactor, changes outlined below:
**functions.less**
- added convenience functions
- `fudge` fudge a number from 0-6 decimal places
- `unitless` simple hack to parse a number from a unit
**icons.less**
- removed explicit definitions in favor of a loop iterating `@fa-var-glyphs`
**mixins.less**
- removed requirement to pass `@rotation` to `@fa-icon-rotate`, it is now calculated
- calculation required since `@fa-rotation-increment` is configurable, meaning not every rotation may adhere to 90 degree increments requiring @rotation
**rotated-flipped.less**
- rotations are now calculated by a loop iterating `@fa-rotation-increment`
- the ie fix is now calculated using a loop iterating only the rotation selectors requiring intervention
- this is required now that `@fa-rotation-increment` eists
**sizes.less**
- sizes are now calculated by a loop iterating `@fa-var-scales`
- this new method supports the existing `.fa-lg` selector, as well as introducing: `.fa-xsm` (33%), `.fa-sm` (66%x), `.fa-default` (100%), `.fa-xlg` (166%)
- multipliers are now calculated by a loop iterating `@fa-var-multipliers`
- this new method supports all existing multipliers (`.fa-2x`, `.fa-3x`, `.fa-4x`, `.fa-5x`)
**variables.less**
- added variables:
- deprecated explicit icon variables in favor of an array value (`@fa-var-glyphs`)
- `@fa-rotation-increment`
- `@fa-var-scales`
- `@fa-var-multipliers`
**font-awesome.less**
- added `functions.less`
**misc.**
- minor code cleanup
2015-06-29 09:43:06 +08:00
|
|
|
.fa-icon-rotate(@degrees) {
|
|
|
|
// check if this ie fix is necessary
|
|
|
|
& 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");
|
2013-10-02 08:58:36 +08:00
|
|
|
}
|
|
|
|
|
2013-10-23 11:40:21 +08:00
|
|
|
.fa-icon-flip(@horiz, @vert, @rotation) {
|
|
|
|
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1);
|
2013-10-02 08:58:36 +08:00
|
|
|
-webkit-transform: scale(@horiz, @vert);
|
|
|
|
-ms-transform: scale(@horiz, @vert);
|
|
|
|
transform: scale(@horiz, @vert);
|
|
|
|
}
|