components icon indicating copy to clipboard operation
components copied to clipboard

md-core mixin not found when building 2.0.0-beta.2

Open fredrik-macrobond opened this issue 9 years ago • 4 comments

Using @angular/material 2.0.0-beta.2 webpack 2.3.0 sass-loader 6.0.0 postcss-loader 1.3.0

I get a build error:

Module build failed: @include md-core(); ^ No mixin named md-core

Backtrace: stdin:7 in R:\fb_wp\sass\angular-material.scss (line 7, column 10) @ ./sass/angular-material.scss 4:14-174

fredrik-macrobond avatar Feb 16 '17 09:02 fredrik-macrobond

Try using mat-core instead.

crisbeto avatar Feb 16 '17 09:02 crisbeto

After the release '2.0.0-beta.2', some prefixes replaced with md- to mat-

For example: Old theming guide code

@import '~@angular/material/core/theming/all-theme';
@include md-core();
$candy-app-primary: md-palette($md-indigo);
$candy-app-accent:  md-palette($md-pink, A200, A100, A400);
$candy-app-warn:    md-palette($md-red);
$candy-app-theme: md-light-theme($candy-app-primary, $candy-app-accent, $candy-app-warn);
@include angular-material-theme($candy-app-theme);

The same code after release '2.0.0-beta.2'

@import '@angular/material/core/theming/all-theme';
@include mat-core;
$candy-app-primary: mat-palette($mat-indigo);
$candy-app-accent:  mat-palette($mat-pink, A200, A100, A400);
$candy-app-warn:    mat-palette($mat-red);
$candy-app-theme: mat-light-theme($candy-app-primary, $candy-app-accent, $candy-app-warn);
@include angular-material-theme($candy-app-theme);

DmytroPotapov avatar Feb 16 '17 10:02 DmytroPotapov

Sorry, this was my mistake. I hadn't updated the scss code that I got from https://github.com/angular/material2/blob/master/guides/theming.md

Everything works now when using the updated code from the link above. And yes, the solution was to exchange the 'md-' prefix to 'mat-'.

Thanks all for your help!

fredrik-macrobond avatar Feb 16 '17 11:02 fredrik-macrobond

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.