Css Modules not working directly from scss files
See original GitHub issueI’m trying to create a new project with:
create-react-app myapp --scripts-version custom-react-scripts
and the following .env file (in root of project):
REACT_APP_SASS=true
REACT_APP_LESS=false
REACT_APP_STYLUS=false
REACT_APP_CSS_MODULES=true
In my component I then try to import a .scss file but it is not creating the styles object correctly and I am getting no styles. e.g.
import style from './style.scss';
console.log(style);
... className={style.label} ...
I’m using version 1.0.3 of create-react-app, is this the problem? do I need to use an older version? Or what could be the issue?
Thanks, and great project!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
CSS modules not working for react version 16.6.0
Not working with React 17.0.1. The only way to make it work is Changing to UpperCase all the css classes in the css...
Read more >How to use Sass and CSS Modules with create-react-app
A CSS Module is a CSS file in which all class names and animation names are scoped locally by default. Basically, same class...
Read more >React + Storybook + SCSS modules not working · Issue #17768
It literally works right out the box, with css/scss/global styles AND modules. My main.js file now looks like this: const path = require('path ......
Read more >How to Use Sass with CSS Modules in Next.js - freeCodeCamp
CSS Modules are essentially CSS files that, when imported into JavaScript projects, provide styles that are scoped to that particular part of ...
Read more >Setup React CSS Modules (with SASS, multiple classes and ...
In this tutorial I want to show you a few tips on how to setup modular scopes css along with setting up sass...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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
Any update on this? I’m still not able to make this work, either.
This will be supported in the next version (released by this sunday) @jnmandal @danielanteloagra