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.

Use CSS modules and global css together?

See original GitHub issue

Hi, with the original create-react-app, I can build global css files into my bundle js like this: import 'font-awesome/css/font-awesome.css Then I switched to custom-react-scripts since I want to use css modules inside my react components, it works great. However, it also breaks the global css import as showed above. Is there anyway I can use both of them? thanks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
wong2commented, Nov 22, 2016

a side note to @dvkndn 's solution: you need to add this line to the beginning of your index.js file to avoid a eslint error: /* eslint import/no-webpack-loader-syntax: "off" */

0reactions
kitzecommented, Nov 22, 2016

@dvkndn awesome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to apply global styles with CSS modules in a react app?
The first rule should be to include all global styles, assuming it's kept in /styles/ or similar directory. · The second rule is...
Read more >
Configuring both CSS Modules and global CSS for ...
In this case, I might want to use both global CSS and CSS modules. This is a simple concept but the tricky part...
Read more >
Using global class selectors in CSS Modules
Today I Learned,using global class selector with CSS Modules. ... This site is build using React, and uses CSS Modules.
Read more >
Applying global CSS styles in a React app
To apply global CSS styles in a React app, write your css in a file with a .css extension and import it in...
Read more >
Global vs. Local Styling In Next.js
The answer is surprisingly simple — to write well-structured CSS that balances global and local styling concerns.
Read more >

github_iconTop Related Medium Post

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