Permalink
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (31 sloc) 751 Bytes
@charset 'utf-8';
/*
* Calculate vmin from px
*/
@function vmin-calc($values, $base: $base-v-size) {
$vmin-values: ();
$count: length($values);
@if $count == 1 {
@return -zf-to-vw($values, $base);
}
@for $i from 1 through $count {
$vmin-values: append($vmin-values, -zf-to-vw(nth($values, $i), $base));
}
@return $vmin-values;
}
@function -zf-to-vw($value, $base) {
@if type-of($value) != 'number' {
@warn inspect($value) + ' was passed to vmin-calc(), which is not a number.';
@return $value;
}
@if unit($value) != 'vmin' {
$value: (strip-unit($value) / strip-unit($base) * 100) * 1vmin;
}
@return $value;
}
/*
* Strip units
*/
@function strip-unit($num) {
@return $num / ($num * 0 + 1);
}