$golden-ratio: 1.61803398875; @function explorer-size($exponent) { $value: $golden-ratio; @if $exponent > 0 { @for $i from 1 through $exponent { $value: $value * $golden-ratio; } } @elseif $exponent < 0 { @for $i from 1 through -$exponent { $value: $value / $golden-ratio; } } @return 1rem * $value; }