微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

gruntjs – “无法确定指南针0.12.7中错误的相反位置”

运行Compass 0.12.7(Alnilam)我重复多次遇到此错误

Running "compass:dev" (compass) task
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
Cannot determine the opposite position of: to
unchanged public/styles/sass/ie_only.scss
unchanged public/img/icons-s6ab39d30ab.png
overwrite public/styles/css/screen.css (2.484s)

我接受它的渐变是错误的,但这里出了什么问题,我该如何缓解这个问题呢?

解决方法

使用指南针0.12.7在我的项目中遇到了同样的问题,并且不可避免地只能通过更新指南针来解决问题.使用位置值为右的线性渐变mixin时会出现问题警告,如下例所示:

div {
  @include background(linear-gradient(to right,red,blue));
}

这将编译成这样的东西(在你的问题中抛出错误):

div {
  background: -webkit-gradient(linear,to right,to left,color-stop(0%,#ff0000),color-stop(100%,#0000ff));
  background: -webkit-linear-gradient(to right,#ff0000,#0000ff);
  background: -moz-linear-gradient(to right,#0000ff);
  background: -o-linear-gradient(to right,#0000ff);
  background: linear-gradient(to right,#0000ff);
}

不幸的是,这是无效的CSS代码.正确的输出应如下:

div {
  background: -webkit-gradient(linear,0% 50%,100% 50%,#0000ff));
  background: -moz-linear-gradient(left,#0000ff);
  background: -webkit-linear-gradient(left,#0000ff);
}

修复它的唯一方法就是更新罗盘,正如我之前所说的那样.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐