Use CSS modules and global css together?
See original GitHub issueHi, 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:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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" */
@dvkndn awesome!