What are CSS Modules?
CSS files in which all class names and animation names are scoped locally by default.
Why use CSS Modules?
With CSS Modules, it’s a guarantee that all the styles for a single component:
This entire approach is designed to fix the global scope issue in CSS.
Here is a good link to getting started with CSS Modules: LINK
We first need to install webpack
yarn add webpack
Next, if you don't have an index.js, make one in /src
index.js
Outside /src, we need to create a webpack.config.js
webpack.config.js
Inside webpack.config, add the following:
module.exports = { entry: './src', output: { path: 'build', filename: 'bundle.js', }, };
There was an error while loading. Please reload this page.