【发布时间】:2020-10-23 23:24:40
【问题描述】:
在 Angular 中,我生成了一个自定义主题文件、一个根样式文件,并且我的所有组件都有自己的自定义样式文件。但是,由于我更新到版本 10,我的终端被警告发送垃圾邮件
WARNING: The same color styles are generated multiple times. Read more about how style duplication can be avoided in a dedicated guide. https://github.com/angular/components/blob/master/guides/duplicate-theming-styles.md
node_modules/@angular/material/_theming.scss 1648:7 -mat-check-duplicate-theme-styles()
node_modules/@angular/material/_theming.scss 7010:3 angular-material-theme()
node_modules/@angular/material/_theming.scss 7061:3 angular-material-color()
src/_custom_theme.scss 242:3 @import
stdin 2:9
按照指南,我可以将此错误减少到至少四个到达。此错误列出了我的 node_modules 中的 custom_theme 文件和 @angular/material。
我真的很想知道我做错了什么导致这个错误。在我的 custom_theme 的第 242 行,我正在生成我的深色主题 .custom-dark-theme { @include angular-material-color($app-theme-dark); }
【问题讨论】:
-
你找到解决方案了吗?
-
其实是的。我会在星期一发布。
-
请不要忘记..我真的需要它..谢谢!
-
解决方案在哪里?
-
@MojioMS 可以分享给我们吗?
标签: angular sass angular-material