[英]Angular Material + Theme Generator => Argument `$color` of `rgba($color, $alpha)` must be a color
我已經使用以下在線工具生成了Angular Material主題: http : //materialtheme.arcsine.org/,並將其包含在styles.css中。 我還重新編譯了node-sass。
但是我(仍然)收到此錯誤:
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
對於遇到相同問題的任何人:我更新到Angular 7.1,現在可以使用了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.