Undefined mixin

限于喜欢 提交于 2021-01-29 14:54:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!