gpt4 book ai didi

css - 在 SASS 中使用自定义参数乘以背景

转载 作者:行者123 更新时间:2023-11-28 16:43:32 24 4
gpt4 key购买 nike

我正在尝试使用 SASS 设置一些多重背景@mixin,所以这是我的代码:

@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;
}

有些地方不对,因为我有错误(第 210 行: undefined variable :“$atributes”。)有谁能够帮助我?非常感谢。

最佳答案

错误不言而喻。您到处都调用了 $atributes 变量,但它从未声明过。

关于css - 在 SASS 中使用自定义参数乘以背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17340655/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com