Angular: mat-core() giving undefined mixin

508 Views Asked by At

it says "./src/styles.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Undefined mixin." this on the terminal when i try to execute my project, says its the @include mat-core problem

tried changing all the import of the angular material many times, it didn't work

1

There are 1 best solutions below

1
On

Por algum motivo ele não reconhecia o @import e o arquivo theming mudou, deve ser por conta da versão 13 talvez, porem consegui desse modo ter o mesmo resultado

@use '@angular/material' as mat;

@include mat.core();

$custom-app-primary: mat.define-palette(mat.$blue-palette);

$custom-app-secondaty: mat.define-palette(mat.$indigo-palette, A200, A400, 700);

$custom-app-warn: mat.define-palette(mat.$red-palette);

$custom-theme: mat.define-light-theme((

color: (

primary: $custom-app-primary,

accent: $custom-app-secondaty,

warn: $custom-app-secondaty,

)

));

@include mat.all-component-themes($custom-theme);

@include mat.core-theme($custom-theme);