如何在角材料中使用css类来处理文本颜色?

问题描述 投票:0回答:1

我有一些创建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)必须是颜色

html css angularjs sass angular-material2
1个回答
1
投票

我已经找到了解决方案。

@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等...

© www.soinside.com 2019 - 2024. All rights reserved.