After successfully implementing a custom color palette with Material 3 and Angular Material Experimental, I am encountering a warning in the console stating "Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide".
Here is an example of what I have done, although it is not my actual code, the same warning message persists when implementing this.
@use '@angular/material' as mat;
@use '@angular/material-experimental' as matx;
$m3-dark-theme: matx.define-theme((
color: (
theme-type: dark,
primary: matx.$m3-green-palette,
tertiary: matx.$m3-blue-palette,
)
));
$m3-light-theme: matx.define-theme((
color: (
primary: matx.m3-$green-palette,
tertiary: matx.$m3-blue-palette,
)
));
@include mat.core();
.dark-theme {
@include mat.all-component-themes($m3-dark-theme);
}
.light-theme {
@include mat.all-component-themes($m3-light-theme);
}
I am hopeful that the warning message will no longer appear in the console after making the necessary adjustments.