问题
I'm using SASS to style a landing page but I am getting an error when I try to compile my sass into CSS. I receive an error that reads
error sass/modules/_buttons.sass (Line 11: Undefined mixin 'button-size'.)
Here is the code for this particular part
.btn
display: inline-block
font-weight: $font-weight-normal
line-height: $base-line-height
text-align: center
font-size: $font-base
vertical-align: middle
border: $border-width solid transparent
transition: $btn-transition
border-radius: $border-radius
+button-size($btn-padding-y, $btn-padding-x, $font-base, $border-radius)
<-- Line 11
and the actual mixin code is
=button-size($btn-padding-y, $btn-padding-x, $font-base, $border-radius)
padding: $btn-padding-y $btn-padding-x
font-size: $font-base
border-radius: $border-radius
回答1:
hi if you have the same problem, you have to import your mixin first in your main.scss
1. import 'utils/mixin' //contain all of my mixin
2. import 'other/css-thing'... //call the mixin above
the mixin can't be write below in the main.scss
来源:https://stackoverflow.com/questions/60517040/undefined-mixin