更新到 Angular 10 后,编译时开始出现一堆错误,都与 Material 自定义主题和 Dart Sass 相关。
例子 :
DEPRECATION WARNING: As of Dart Sass 2.0.0, !global assignments won't be able to
declare new variables. Consider adding `$mat-form-field-legacy-dedupe: null` at the root of the
stylesheet.
?
6155 ? $mat-form-field-legacy-dedupe: $mat-form-field-legacy-dedupe + 0.00001 !global;
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
?
node_modules/@angular/material/_theming.scss 6155:3 -mat-form-field-legacy-label-floating()
node_modules/@angular/material/_theming.scss 6206:9 mat-form-field-legacy-typography()
node_modules/@angular/material/_theming.scss 6726:3 mat-form-field-typography()
node_modules/@angular/material/_theming.scss 6871:3 angular-material-typography()
node_modules/@angular/material/_theming.scss 6899:3 mat-core()
src/theme.scss 2:1 @import
stdin 36:13 root stylesheet
Run Code Online (Sandbox Code Playgroud)
所有错误都由@include mat-core();或触发@include angular-material-theme($my-theme);,两者都存在于我的自定义theme.scss文件中。
但有罪的 …