2014-11-20 49 views
5

運行北斗0.12.7(參宿二),我遇到了此問題多次重複:「無法確定的相反的位置:爲」錯誤北斗0.12.7

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) 

這是什麼問題我接受了我的漸變,但是這裏出了什麼問題,我該如何緩解這個問題?

回答

2

我在使用指南針0.12.7的項目上遇到了同樣的問題,而且這個問題只能通過更新指南針來解決。

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

這將被編譯成這樣的事情(你扔的錯誤在你的問題):

發出警告使用與 to right就像在下面的例子中的位置值 linear-gradient混入時產生
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, #ff0000, #0000ff); 
    background: -o-linear-gradient(to right, #ff0000, #0000ff); 
    background: linear-gradient(to right, #ff0000, #0000ff); 
} 

不幸的是,這是無效的CSS代碼。正確的輸出應該如下:

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

解決它的唯一方法就是更新指南針,就像我之前說過的那樣。

0

如果你不能/不想更新你的sass,你可以刪除那個「to」屬性。

默認SASS梯度是垂直:

@include background(linear-gradient(red, blue)); 

爲了獲得水平:

@include background(linear-gradient(90deg, red, blue));