Answer the question
In order to leave comments, you need to log in
How to compile stilys function to sass?
$font-size-base = 12px
$line-height-base = 16px
text-margin($top, $right, $bottom, $left, $font-size = $font-size-base, $line-height = $line-height-base)
if $top != 0
$top = $top - ($line-height - $font-size) / 2
if $bottom != 0
$bottom = $bottom - ($line-height - $font-size) / 2
margin $top $right $bottom $left
Answer the question
In order to leave comments, you need to log in
Here the difference is only in the assignment. In stylus, the "equal" sign, in sass - "colon"
$font-size-base: 12px
$line-height-base: 16px
text-margin($top, $right, $bottom, $left, $font-size: $font-size-base, $line-height: $line-height-base)
if $top != 0
$top: $top - ($line-height - $font-size) / 2
if $bottom != 0
$bottom: $bottom - ($line-height - $font-size) / 2
margin: $top $right $bottom $left
@mixin text-margin($top, $right, $bottom, $left, $font-size: $font-size-base, $line-height: $line-height-base) {
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question