错误:属性"#{$ name}"必须遵循':'

时间:2017-06-12 10:16:23

标签: sass

甚至可以这样做吗?编译后我收到此错误错误:属性&#34;#{$ name}&#34;必须遵循&#39; <#39;

它呻吟的路线是 @include hidden - #{$ name};

@mixin generate-visibility {
    @each $name in ($break-list) {
        .hidden--#{$name} {
            @include hidden-#{$name};
        }
    }
}

有人有任何建议吗?

1 个答案:

答案 0 :(得分:0)

Sass不允许在名称mixins和函数中进行插值,所以下一个:

@mixin foo{
  content:'foo';
}

.foo{
  @include #{'foo'};
}

返回

Invalid CSS after "  @include ": expected identifier, was "#{'foo'};"

发布here