gpt4 book ai didi

CSS SASS if else if 语句

转载 作者:行者123 更新时间:2023-11-28 10:45:15 24 4
gpt4 key购买 nike

<分区>

是否可以在 SASS 中使用 else if?

像这样:

if(1+1 = 1) {

} else if(2+1=4) {

} else {

}

我有以下内容但它不起作用:

$color: "blue", "green", "orange", "red", "pink", "grey", "black"

@for $i from 1 through length($color)
.color-#{ nth($color, $i) }
@if nth($color, $i) == "pink" or "grey"
color: #f00
@else if nth($color, $i) == "black"
color: #0f0
@else if nth($color, $i) == "orange"
color: #000
@else
color: #fff

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