-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
语句