sass动态实现颜色平铺显示

@function stripes($position,$colors) {
$colors: if(type-of($colors)!='list', compact($colors), $colors);
$gradient: compact();
$len: length($colors);
$ percentage(1 / $len);

@for $i from 1 through $len {
$current-color: nth($colors, $i);
$temp: $current-color ($width * ($i - 1)), $current-color ($width * $i);
$gradient: join($gradient, $temp, comma);
}
@return linear-gradient($position, $gradient);
}

$pop-stripe-color:red orange yellow green blue purple...;
没有人能一路单纯到底,但是要记住,别忘了最初的自己!
原文地址:https://www.cnblogs.com/LindaBlog/p/10404805.html