score:3

Accepted answer

Open up one of your .module.css file, and paste this:

body {
    background-color: red;
}

CSS modules, just like CSS files, are imported and applied globally by Webpack.

If you want to create another .module.css just for the body tag, then you can create a new module, for example, MyModule.module.css and paste the above code. Then, import this new module to one of your tsx file.

You don't need to do anything with it, just import like this:

import myStyles from "./MyModule.module.css";

Related Query

More Query from same tag