Fixed bugs with sizing, added some attributions.

pull/82/head
Macdonald, Zak 9 years ago
parent 004a98ca2b
commit 2f876ce97f

@ -1,6 +1,8 @@
// base class definition
// --------------------------
// lifted from FontAwesome
// https://github.com/FortAwesome/Font-Awesome/blob/6549e2920b0a27213b895200becc485ab01e9974/scss/core.scss
.#{$wi-css-prefix} {
display: inline-block;

@ -1,6 +1,8 @@
// icon font
// --------------------------
// lifted from FontAwesome
// https://github.com/FortAwesome/Font-Awesome/blob/6549e2920b0a27213b895200becc485ab01e9974/scss/path.scss
@font-face {
font-family: 'WeatherIcons';

@ -1,7 +1,39 @@
// functions
// --------------------------
@function strip-units($number) {
// extract the number from a unit
@function unitless($number) {
@return $number / ($number * 0 + 1);
}
// fudge a number to an accuracy of n <= 6 decimal places
@function fudge($number, $places: 0) {
$fraction: 10;
$number: unitless($number);
$return: null;
@if $places == 0 {
@return round($number);
} @else {
@if $places > 6 {
$places: 6;
}
// how sweet life could be with some simple trig... no loop necessary
// $fraction: (10 ^ $places);
// @return round($number * $fraction) / $fraction;
@for $i from 1 through $places {
$fraction: $fraction * 10;
}
@return round($number * $fraction) / $fraction;
}
}

@ -6,8 +6,8 @@
.#{$wi-css-prefix}-#{$wi-icon-scale-name} {
font-size: ($wi-font-size-base / strip-units($wi-font-size-base * $wi-icon-scale));
line-height: ($wi-font-size-base * $wi-icon-scale / strip-units($wi-font-size-base));
font-size: #{fudge(unitless($wi-font-size-base) * $wi-icon-scale)}px;
line-height: #{fudge(unitless($wi-font-size-base) * $wi-icon-scale * 0.75)}px;
vertical-align: -15%;
}
}
@ -17,6 +17,6 @@
.#{$wi-css-prefix}-#{$wi-icon-multiplier-name} {
font-size: ($wi-font-size-base * $wi-icon-multiplier);
font-size: #{fudge($wi-font-size-base * $wi-icon-multiplier)}px;
}
}

Loading…
Cancel
Save