title: CSS Modules vs. normal CSS to change background of page in React
body: <p>Edit: The accepted answer helped me arrive at the problem. It is correct so I accepted it. But I was importing my module which included the <code>body</code> tag and not using it. </p>
  
  <p><code>import styles from "./App.module.css"; //Includes a body tag</code></p>
  
  <p><code>styles</code> isn't used anywhere in the code, so I don't think WebPack was including it. If I did <em>anything</em> with that module, the body tag was included and it worked. <code>&lt;div className={styles.anything}&gt;</code> allowed the <code>body</code> CSS to be included.</p>
  
  <p>This could be due to Typescript as the answerer said in a comment.</p>
  
  <hr>
  
  <p>I used <code>create-react-app</code> to make an app. I'm using CSS Modules in my components. I'm trying to figure out how to use CSS Modules to make the overall background of the page a different color.</p>
  
  <p>I want to apply <code>background-color: #121212;</code> to the entire background.</p>
  
  <p>I'm trying to figure out how to apply that style, and right now it seems it would need to be applied to the <code>body</code> tag.</p>
  
  <p>Any styles applied to <code>App.tsx</code> only affect the container which that component takes up (The background is colored only to the bottom of the <code>App</code> component and white below it)</p>
  
  <p>Right now <code>index.css</code> contains</p>
  
  <pre><code>body {
    ...
    background-color: #121212;
  }
  </code></pre>
  
  <p>This works fine. I'd like to use modules though, and I don't know how I can import that style to work. </p>
  
  <p>Where would I import a style on the <code>index.tsx</code> file created by <code>create-react-app</code> with Webpack.</p>
  
  <p><code>ReactDOM.render(&lt;App /&gt;, document.getElementById('root'));</code></p>