coachcare / npm-datepicker

Material Datepicker Fork with TimePicker by CoachCare
MIT License
32 stars 18 forks source link

Custom theme not applied #29

Open xuko opened 5 years ago

xuko commented 5 years ago

I'm trying to add my custom theme, but it isn't applied. it seems that the problem is that the official material theme has a mixin with the same name @mixin mat-datepicker-theme($theme)

@import '~@angular/material/theming';
@import '~@coachcare/datepicker/theming';

@mixin theme($theme) {
  @include angular-material-theme($theme);
  @include mat-datepicker-theme($theme);
}
mhagnumdw commented 4 years ago

I have the same problem!

My theme.scss

// ...
@import '~@coachcare/datepicker/theming';

@include mat-core();
// ...

@mixin custom-components-theme($palette) {
  @include menu-theme($palette);
  @include user-menu-theme($palette);
  @include notification-snackbar($palette);
  @include mat-datepicker-theme($palette);
}

.default-theme {
  @include theme-color-grabber($default-theme);
  @include angular-material-theme($default-theme);
  @include custom-components-theme($default-theme);
}

.dark-theme {
  @include theme-color-grabber($dark-theme);
  @include angular-material-theme($dark-theme);
  @include custom-components-theme($dark-theme);
}
matheo commented 3 years ago

Theming got more aligned to Angular Material v11 in the latest version https://github.com/matheo/angular/tree/master/libs/datepicker#theming