【发布时间】:2018-09-06 16:18:45
【问题描述】:
如果我使用返回错误的内置 Sass 函数,它将显示使用位置的路径。
使用内置的 Sass 函数:
来自_test.scss的代码。
.foo {
color: darken(blue, s);
}
将导致:
error _test.scss(第 2 行:$amount: "s" 不是 `darken' 的数字)
现在,如果我使用返回错误的自定义函数,它将显示定义位置的路径,而不是使用位置。
使用自定义函数:
来自_test.scss的代码。
.foo {
color: example(string);
}
来自_functions.scss的代码。
@function example($string) {
@error 'error message';
}
将导致:
error core/utils/_functions.scss(第2行:错误信息)
有什么办法可以解决这个“问题”吗?
【问题讨论】: