question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to compile custom theme

See original GitHub issue

I’m not able to set the custom material theme like in Theming your Angular Material app guide.

When I add the scss code like in the sample:

@import '~@angular/material/core/theming/all-theme';
// Plus imports for other components in your app.

// Include the base styles for Angular Material core. We include this here so that you only
// have to load a single css file for Angular Material in your app.
@include md-core();

// Define the palettes for your theme using the Material Design palettes available in palette.scss
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue.
$candy-app-primary: md-palette($md-indigo);
$candy-app-accent:  md-palette($md-pink, A200, A100, A400);

// The warn palette is optional (defaults to red).
$candy-app-warn:    md-palette($md-red);

// Create the theme object (a Sass map containing all of the palettes).
$candy-app-theme: md-light-theme($candy-app-primary, $candy-app-accent, $candy-app-warn);

// Include theme styles for core and each component used in your app.
// Alternatively, you can import and @include the theme mixins for each component
// that you are using.
@include angular-material-theme($candy-app-theme);

When I run node-sass, I’m getting the error:

{ “status”: 1, “file”: “/home/skined/workspace/project/src/scss/style.scss”, “line”: 5, “column”: 1, “message”: “File to import not found or unreadable: ~@angular/material/core/theming/all-theme\nParent style sheet: /home/skined/workspace/project/src/scss/style.scss”, “formatted”: “Error: File to import not found or unreadable: ~@angular/material/core/theming/all-theme\n Parent style sheet: /home/skined/workspace/project/src/scss/style.scss\n on line 5 of src/scss/style.scss\n>> @import ‘~@angular/material/core/theming/all-theme’;\n ^\n” }

Am I doing something wrong?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:40 (4 by maintainers)

github_iconTop GitHub Comments

17reactions
mafavcommented, Apr 2, 2017

Looks like they’ve changed the Github build of Material. Instead of

@import ‘~@angular/material/core/theming/all-theme’;

Try this out:

@import ‘~@angular/material/_theming.scss’;

16reactions
weichen2046commented, Apr 8, 2017

There is no ./node_modules/@angular/material/core/theming/_all-theme.scss file any more after I upgrade from "@angular/material": "^2.0.0-beta.2 to "@angular/material": "^2.0.0-beta.3. You shold use @import '~@angular/material/theming' instead. I think the theming guide should update too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Theme Module Can Not Be Resolved - Stack Overflow
json in the styles key. But when I compile, I get Module not found: Error: Can't resolve '@angular/material/prebuilt-themes/diabetes-chart ...
Read more >
Custom Theme Does not Compile Anymore - PrimeFaces forum
Did you really try to create and compile a custom theme? I did all the steps but it does not work. Code: Select...
Read more >
crestron@groups.io | Help! VTPro Freezes when Compiling ...
I got .vta from my previous PC, which imported the custom theme. I was able to compile the .vtp a few times. Then...
Read more >
Problem while compile less in custom theme of magento 2
Is it process compile less in module first then go to web folder of theme? enter image description here Testing with Magento 2.0.2...
Read more >
Save and Build Custom Theme Failed - SAP Community
EDIT: I just saw the errors in the console log, they are saying that the sap/me/themes/sap_blucrystal/library.css could not be found. I ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found