I am new to nextjs
I have a css class in styles/globals.css:
.section-sidebar-filter-name {
margin: 0 0 .5rem;
}
and I have the import statement in pages/_app.js:
import '../styles/globals.css'
function MyApp({ Component, pageProps }) {
...
};
but the CSS class style is not applied to the react components in the pages when I view it in chrome browser developer mode ( Example: test.js page ):
function Test() {
return(
<h3 className="c-clickable section-sidebar-filter-name">Test</h3>
)
}
next.config.js:
module.exports = {
webpack: (config) => {
const rules = config.module.rules
.find((rule) => typeof rule.oneOf === 'object')
.oneOf.filter((rule) => Array.isArray(rule.use));
rules.forEach((rule) => {
rule.use.forEach((moduleLoader) => {
if (moduleLoader.loader.includes('css-loader') && !moduleLoader.loader.includes('postcss-loader')) {
delete moduleLoader.options.modules.getLocalIdent;
moduleLoader.options = {
...moduleLoader.options,
modules: {
...moduleLoader.options.modules,
localIdentName: '[folder]__[local]--[hash:base64:5]',
// getLocalIdent: (context, localIdentName, localName, options) => {
// return "whatever_random_class_name";
// },
// You can also add other css-loader options here
}
};
}
});
});
return config;
}
};
anyone knows what I did wrong?