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.

Invalid style specified! Choose one of primary, accent, background, ........

See original GitHub issue

Problem description

main.scss :

//$mdc-theme-primary: #9c27b0;
//$mdc-theme-accent: #76ff03;
//$mdc-theme-background: #fff;

@import "material-components-web/material-components-web";
@import "./_color";
....

Error when add @import "material-components-web/material-components-web";

ERROR in ./node_modules/css-loader!./node_modules/resolve-url-loader!./node_modu
les/sass-loader/lib/loader.js?{"sourceMap":true,"includePaths":["E://Project//al
lproject_git//react-boilerplate//node_modules"]}!./app/styles/main.scss
Module build failed:
undefined
          ^
      Invalid style specified! Choose one of primary, accent, background, text-p
rimary-on-primary, text-secondary-on-primary, text-hint-on-primary, text-disable
d-on-primary, text-icon-on-primary, text-primary-on-accent, text-secondary-on-ac
cent, text-hint-on-accent, text-disabled-on-accent, text-icon-on-accent, text-pr
imary-on-background, text-secondary-on-background, text-hint-on-background, text
-disabled-on-background, text-icon-on-background, text-primary-on-light, text-se
condary-on-light, text-hint-on-light, text-disabled-on-light, text-icon-on-light
, text-primary-on-dark, text-secondary-on-dark, text-hint-on-dark, text-disabled
-on-dark, text-icon-on-dark
      in E:\Project\allproject_git\react-boilerplate\node_modules\@material\them
e\_mixins.scss (line 26, column 12)
 @ ./app/styles/main.scss 4:14-179 18:2-22:4 19:20-185
 @ ./app/containers/App/index.js
 @ ./app/app.js
 @ multi eventsource-polyfill webpack-hot-middleware/client?reload=true ./app/ap
p.js

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
eromoecommented, Aug 29, 2017

@pvamshi Sorry, I just misunderstand you (looking too quickly …)

The full situation is:

  1. material-components-web 0.17.0 installed, got this error
  2. tried update, npm update material-components-web (But I fogot add --save, so package.json not update) , still error
  3. see your comment, check the package.json fix vertion to 0.19.0, and install @material/theme , still this error.

Now I uninstall @material/theme, it go to normal.

0reactions
eromoecommented, Aug 29, 2017

I hadn’t have that when you ask me, then I tried to install it see what would happen , but still same error. At first, I think you are asking me delete node_module , update material-components-web to lastest and install @material/theme

Read more comments on GitHub >

github_iconTop Results From Across the Web

accent-color - CSS: Cascading Style Sheets - MDN Web Docs
Represents a UA-chosen color, which should match the accent color of ... and <color> values are computed as defined for the color property....
Read more >
How to get primary or accent color of currently applied theme ...
My goal was to be able to style non-Material elements (such as standard DIVs, SPANs, etc) with different colors depending on which Material ......
Read more >
accent-color - CSS-Tricks
The accent-color property in CSS is capable of re-tinting the accented color of form controls provided by the browser's default styles with ...
Read more >
The color system - Material Design
Having a secondary color is optional, and should be applied sparingly to accent select parts of your UI. If you don't have a...
Read more >
Theming your own components - Angular Material
This function returns a Sass map containing the theme's primary, accent, ... Each mixin emits all color and typography styles for that component, ......
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