【问题标题】:sass compile issue with @use and @forward@use 和 @forward 的 sass 编译问题
【发布时间】:2020-07-17 04:05:51
【问题描述】:

我已经研究了好几个小时了,这让我发疯了。我已经尝试了 3 个编译器,它们都给出了相同的错误。

Error: no mixin named flex

我的代码:

// 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;
}

【问题讨论】:

  • 您使用的是哪个 sass 版本(node-sassdart-sass、...)?

标签: css django sass


【解决方案1】:

你需要使用一个使用 Dart Sass 的编译器。

我建议使用prepros。他们有免费版和付费版,两者最大的区别是免费版有一个烦人的弹出窗口。

【讨论】:

  • 啊啊啊这行得通。我不知道那是 Dart Sass,但它解决了问题。谢谢!
猜你喜欢
  • 2021-08-29
  • 2021-09-13
  • 1970-01-01
  • 2021-02-20
  • 2020-05-14
  • 2021-05-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多