I'm trying to write a simple function to generate utility classes with Stylus:
spacer-maker($class, $property, $steps = 12)
for $i in 1..$steps
if $i < 5
$step = .25
$multiplier = $i
else
$step = 1
$multiplier = $i - 3
$value = $multiplier * $step
.{$class}-{$i}
{$property}: $value rem
spacer-maker('mt', 'margin-top')
This is working as expected EXCEPT the unit value rendered is ks-rem
not rem
:
.mt-1 {
margin-top: 0.25 ks-rem;
}
I can't see any reason for this to happen, and have been trying all matter of workarounds to just output rem
correctly but cannot find a working solution.
I'm using webpack driven compilation but have not had any other Stylus compilation issue to date.