我有一些创建css类的代码。但是它无法正常工作。如何解决?
@for $i from 1 through 100 {
$hue : $i;
.mat-blue-#{$i} {
color : mat-color($mat-blue, $hue);
}
}
错误
错误:@return rgba($ color,$ opacity); ^
$color
的论据rgba($color, $alpha)
必须是颜色
我已经找到了解决方案。
@for $i from 100 through 1000 {
$hue : $i;
.mat-blue-#{$i} {
color : map-get($mat-blue,$hue);
}
}
该代码创建类.mat-blue-100,.mat-blue-400,.mat-blue-800等...