【问题标题】:What am I doing wrong with npm susy and grunt?我在使用 npm susy 和 grunt 时做错了什么?
【发布时间】:2019-07-30 05:10:51
【问题描述】:

我正在尝试使用 susy、node-sass、grunt-sass 编译我的 scss 文件 我使用 npm install 添加了所有这些依赖项。 我正在为 grunt 添加设置

sass: {
      options: {
        implementation: sass,
        sourceMap: true
      },
      dist: {
        options: {
          style: 'expanded',
          require: 'susy'
        },
        files: {
          'app/crossbrand_us/styleguide/css/shared.css': 'app/sass/xb/widgets/advertised-offers/wdgt-advertised-offers-vehicle.scss'
        }
      }
    },
@import "wdgt-advertised-offers-shared";
@import "node_modules/susy/sass/susy";
$wdgt-advertised-offers-vehicle-selector: ".wdgt-advertised-offers-vehicle";

#{$wdgt-advertised-offers-vehicle-selector} {
    @include pad(1%);
 }

但这会引发错误

Fatal error: no mixin named pad

我该如何解决这个问题?

【问题讨论】:

    标签: sass gruntjs susy-compass susy susy-sass


    【解决方案1】:

    Susy (3.x) 的 latest versions 不包含任何 mixin。为了使用旧的 mixin,你必须降级到 Susy 的 2.x 版本(2.2.14 是最新的)。或者查看the docs 以开始使用 Susy 3。

    我不确定设置中是否还有其他问题……

    【讨论】:

    • 是的,就是这样。我试图用 nodejs 更改一个旧项目,我降级到 2.2.12,就像 gem install susy 一样。它开始滚动。 :)
    • 很高兴听到这个消息!
    猜你喜欢
    • 2013-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多