sass mixin在颜色字符串中出错

时间:2015-08-22 01:29:42

标签: html css sass

我试图取消将作为参数传递给mixin的变量取消引用,并且我不断收到此错误。我已经使用了unquote来不让我成为一个字符串,但是我仍然遇到这个错误,我试图保留hsla并且有一个后备颜色可以有人帮助我

错误:

/*Error: $color1: "hsla(118, 77%, 53%, 1)" is not a color for `mix'
  on line 5 of sass/base/mixins.scss, in `color'

SASS:

@include color(background unquote("hsla(118, 77%, 53%, 1)"))

@mixin color($properties...){
    @each $property in $properties {
        $value: nth($property, 2);
        $color: unquote($value);
        #{nth($property, 1)}:mix($color, $color); // error here on $color                   
        #{nth($property, 1)}:nth($property, 2)
    }
}

0 个答案:

没有答案