Open mcdowellalex opened 2 years ago
I have seen some solutions to issues like this (in other contexts, not necessarily in netlifyCMS) that modify the config for the css loader. I believe that netlifyCMS uses the css-loader package, a part of webpack, but I'm not sure.
But, others with issues like this found that adding something like
options: {
modules: false
}
to the webpack config solved it.
I don't know exactly where to go in a gatsby/netlifyCMS project to try this though.
Short description: I am using react/gatsby and netlify cms. I am making a custom widget and the styles are not loading. My goal is to use css classes. The styles work as intended when the component is used on a page in the site but not when it is used in the CMS.
For example: mywidget.css
myWidget.js
The above component will render the background red if I use the component on a normal page, like the home page of the site. However, the background is not red when I use the same component in the CMS.
To reproduce: create a custom widget. try and import any "test.css" file. use css class like this:
Versions: all should be the most recent. here are the dependencies in my package.json
Additional context My custom widget works fine when I use style rather than className, but I need to use className in this context. And I didn't add the whole project and custom widget component because that is not the issue here, all of that functions properly. The issue is simply that css does not load into a component in netlify CMS