-1
我想設定一些SASS多個背景@mixin,所以這是我的代碼自訂參數:倍增背景與SASS
@mixin background_multiplied($background_1, $background_2: false, $background_3: false) {
$params: url('../#{$background_1}') $atributes;
@if $background_2 != false {
$params: url('../#{$background_1}') $atributes, url('../#{$background_2}') $atributes;
}
@if $background_3 != false {
$params: url('../#{$background_2}') $atributes, url('../#{$background_2}') $atributes, url('../#{$background_3}') $atributes;
}
@each $attr in $atributes {
@if $attr == position_horizontal {
$position_horizontal: center
}
@if $attr == position_vertical {
$position_vertical: top
}
@if $attr == bg_repeat {
$bg_repeat: no-repeat
}
@if $attr == bg_size {
$bg_size: auto
}
}
background: $params;
}
東西是不正確公元前我有error (Line 210: Undefined variable: "$atributes".)
任何人可以幫助我?很多thx。
那麼我需要把它們放在哪裏? – Lukas
當你聲明你正在使用的其他變量時,你把它們放在同一個地方嗎? – cimmanon