2017-09-15 18 views
0

我想創建這樣的一個關鍵幀SCSS混入SCSS混入一個多個參數期望的效果:使用後的又一

.divs-class-name { 
    -webkit-animation: myAnimationName 1s forwards; 
    -moz-animation: myAnimationName 1s forwards; 
    -ms-animation: myAnimationName 1s forwards; 
} 

,但我在編譯得到一個錯誤:

Mixin "useKeyframes" does not accept a content block. 

我想我串聯在mixin的參數以錯誤的方式。有沒有其他辦法可以做到這一點?

+1

?嘗試更新軟件包... – Dekel

+1

https://www.sassmeister.com/gist/75b57038293d7766ab820d866b146b92沒關係。 – 3rdthemagical

+0

大括號在最後我'@包括'mixin是問題。用'@include useKeyframes(myAnimationName,1s,forwards)替換它''工作! –

回答

0

大括號到底在哪裏我混搭是問題所在。用@include useKeyframes(myAnimationName, 1s, forwards);取代了工作!

以下是整個代碼:

@mixin useKeyframes($name, $duration, $direction) { 
    -webkit-animation: $name $duration $direction; 
    -moz-animation: $name $duration $direction; 
    -ms-animation: $name $duration $direction; 
} 

.divs-class-name { 
    @include useKeyframes(myAnimationName, 1s, forwards); 
} 

感謝@ 3rdthemagical這個!

1

錯誤說你必須在你的mixin中有一個@content,或者當你嘗試@include your mixin並且它應該工作時刪除花括號。

更多細節在這裏About @content in scss您正在使用什麼版本的青菜