当散列附加到变量时编译sass时出现Koala错误

时间:2018-06-12 21:16:19

标签: sass koala

我正在使用Koala sass编译器。我的错误是:

 "You probably don't mean to use the color value `blue' in interpolation here.
     It may end up represented as #0000ff, which will likely produce invalid CSS.
     Always quote color names when using them as strings (for example, "blue").
     If you really want to use the color value here, use `"" + $state'."

我尝试了错误中列出的解决方案的不同变体无济于事。通读了这个帖子之后,我读到你可以在不引发错误的情况下将“color-”添加到#{$ color}值,但是我在我的文件中使用了#{$ state}值并且只抛出了上述错误。我正在运行最新版本的Koala和Sass。

以下是我的代码示例:

  @mixin table-row-variant($state, $background) {
  // Exact selectors below required to override `.table-striped` and prevent
  // inheritance to nested tables.
  .table-#{$state} {
    &,
    > th,
    > td {
      background-color: $background;
    }
  }

0 个答案:

没有答案