I’ve succesfully applied custom color palette with Material 3 and Angular Material Experimental, but I keep getting the warning in console “Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide”.
This is pretty much what I’ve done, not my actual code, but it helps to prove the point, same message appears 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-indigo-palette,
tertiary: matx.$m3-blue-palette,
)
));
$m3-light-theme: matx.define-theme((
color: (
primary: matx.$m3-indigo-palette,
tertiary: matx.$m3-blue-palette,
)
));
.dark-theme {
@include mat.all-component-themes($m3-dark-theme);
}
.light-theme {
@include mat.all-component-themes($m3-light-theme);
}
I expect the warning message not to appear in the console
Gonzalo Unzueta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.