Modular CSS Classes and Elements

A goal of modular CSS is to scope styles to components. Globally styling elements like h1 is to be done sparingly. Instead, we use class syntax: /* Component.module.css */ . header { color : purple ; } // Component.tsx import { styles } from './Component.module.css' ; const Component = () => { return ( < section > < h1 className = { styles . header }> A purple header here 💜 </ h1 > </ section >…