matheo / angular

Open Source Angular Libraries: MatDataSource, MatDatepicker
http://matheo.co/demos/
MIT License
60 stars 15 forks source link

Build warning: The same color styles are generated multiple times #37

Closed MichalK6677 closed 3 years ago

MichalK6677 commented 3 years ago

Describe the bug

When I use my custom theming then threre is a warning in build: 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\core\theming\_theming.scss 312:7 private-check-duplicate-theme-styles() node_modules\@matheo\datepicker\_theming.scss 360:3 mat-datepicker-theme() src\@shs\scss\theme.scss 10:5 shs-core-theme() src\app\scss\themes\_light.theme.scss 121:5 @use src\app\scss\app.theme.scss 5:1 @use src\styles.scss 5:1 root stylesheet


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\core\theming\_theming.scss 312:7 private-check-duplicate-theme-styles() node_modules\@matheo\datepicker\_theming.scss 360:3 mat-datepicker-theme() src\@shs\scss\theme.scss 10:5 shs-core-theme() src\app\scss\themes\_light.theme.scss 136:9 @use src\app\scss\app.theme.scss 5:1 @use src\styles.scss 5:1 root stylesheet


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\core\theming\_theming.scss 312:7 private-check-duplicate-theme-styles() node_modules\@matheo\datepicker\_theming.scss 360:3 mat-datepicker-theme() src\@shs\scss\theme.scss 10:5 shs-core-theme() src\app\scss\themes\_dark.theme.scss 116:5 @use src\app\scss\app.theme.scss 6:1 @use src\styles.scss 5:1 root stylesheet

Minimal Reproduction

I have more themes in the application and I call "@include datePickerTheming.mat-datepicker-theme($theme)" for every theme the same way like for other components. This datepicker gives me the error during ng serve.

Expected behavior

No build warnings.

MichalK6677 commented 3 years ago

I used @include datePickerTheming.mat-datepicker-color($theme); instead of @include datePickerTheming.mat-datepicker-theme($theme) and that fixed the issues.