scss - 语法抛出不是有效值'某些地方的错误,而不是其他地方

时间:2016-10-31 17:48:31

标签: sass gulp zurb-foundation

我遇到了一个scss的奇怪问题(使用基金会,但我不确定这是一个基础问题) 使用gulp-sass v3.7.3和gulp v3.9.1

// 14. Close Button
// ----------------

$closebutton-position: right top;
$closebutton-offset-horizontal: (
        small: .66rem,
        medium: 1rem,
);
$closebutton-offset-vertical: (
        small: .33em,
        medium: .5rem,
);
$closebutton-sizes: (
        small: 1.5em,
        medium: 2em,
);
$closebutton-lineheight: 1;
$closebutton-color: $dark-gray;
$closebutton-color-hover: $black;

此块会引发以下错误:

Error in plugin 'sass'
Message:
    bower_components/myfoundation/scss/_settings.scss
Error: (small:0.66rem,medium:1rem) isn't a valid CSS value.
        on line 349 of bower_components/emerald/scss/_settings.scss
>>         small: .66rem,
   --------^

Error in plugin 'sass'
Message:
    bower_components/myfoundation/scss/_settings.scss
Error: (small:0.66rem,medium:1rem) isn't a valid CSS value.
        on line 349 of bower_components/emerald/scss/_settings.scss
>>         small: .66rem,
   --------^

奇怪的是,如果我注释掉$closebutton-offset-horizontal$closebutton-offset-vertical变量中的值,即使$closebutton-sizes使用完全相同的语法,所有内容都没有错误构建: / p>

Builds with no errors:
// 14. Close Button
// ----------------

$closebutton-position: right top;
$closebutton-offset-horizontal: (
        //small: 0.66rem,
        //medium: 1rem,
);
$closebutton-offset-vertical: (
        //small: .33em,
        //medium: .5rem,
);
$closebutton-sizes: (
        small: 1.5em,
        medium: 2em,
);
$closebutton-lineheight: 1;
$closebutton-color: $dark-gray;
$closebutton-color-hover: $black;

我已经过了一点点,但它似乎与使用浮动/整个值或ems / rems无关

0 个答案:

没有答案