我已使用此在线工具生成了一个角度材质主题:
http://materialtheme.arcsine.org/
并将其包含在styles.css中。我还重新编译了节点sas。
但我(仍然)得到了这个错误:
Argument `$color` of `rgba($color, $alpha)` must be a color
在node_modules/@angular/material/_theming.scss(第1277行,第11列)中。以下是出现问题的函数:
@function mat-color($palette, $hue: default, $opacity: null) {
// If hueKey is a number between zero and one, then it actually contains an
// opacity value, so recall this function with the default hue and that given opacity.
@if type-of($hue) == number and $hue >= 0 and $hue <= 1 {
@return mat-color($palette, default, $hue);
}
$color: map-get($palette, $hue);
$opacity: if($opacity == null, opacity($color), $opacity);
@return rgba($color, $opacity);
}
你知道这是怎么回事吗?生成的样式如下所示:
https://github.com/arciisine/MaterialThemeGenerator/blob/master/src/styles
我使用的是材料6.4.6