-1
寫這個的正確方法是什麼?Sass:將默認值設置爲變量
@mixin image-bg($bg-url, $full-page: false)
background-repeat: no-repeat
background-position: center
background-image: asset-url($bg-url)
background-attachment: fixed
@if $fullpage
-webkit-background-size: cover
-moz-background-size: cover
-o-background-size: cover
background-size: cover
我想將$ full-page變量傳遞給@mixin。當用戶將$ full-page設置爲true時,它將使用cover
語句。如果沒有給予或設置爲false,也不會使用cover
語句