How to apply global styles with CSS modules in a react app?

Since you’re using the ES6 import syntax you may use the same syntax to import your stylesheet

import './App.css'

Also, you can wrap your class with :global to switch to the global scope (this mean CSS Module won’t modulify it, eg: adding a random id next to it)

:global(.myclass) {
  background-color: red;

Leave a Comment