@use 和 @forward 的 sass 编译问题 [英] sass compile issue with @use and @forward
本文介绍了@use 和 @forward 的 sass 编译问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经研究了几个小时了,这让我发疯了.我尝试了 3 个编译器,它们都给出了相同的错误.
I've been researching this for hours now and its driving me nuts. I've tried 3 compilers and they all give the same error.
错误:没有名为 flex 的 mixin
我的代码:
// style.scss
@use "mixins" as *;
.home {
.header {
@include flex(column);
padding: 20px 10px 0;
text-align: center;
}
}
// _mixins.scss
@forward "mixins/flex";
@forward "mixins/overlay";
// mixins/_flex.scss
@mixin flex($flex-flow: row, $justify-content: center, $align-items: center) {
display: flex;
justify-content: $justify-content;
align-items: $align-items;
flex-flow: $flex-flow;
}
推荐答案
您需要使用使用 Dart Sass 的编译器.
You'll need to use a compiler that uses Dart Sass.
我建议使用 prepros.他们有免费版和付费版,两者最大的区别是免费版有一个烦人的弹窗.
I recommend using prepros. They have a free version and a paid version, the biggest difference between the 2 is that the free version has an annoying popup.
这篇关于@use 和 @forward 的 sass 编译问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文