In my React app I had some messed up combination of inline JS styles and CSS classes. I decided to split up everything into CSS modules that I can use this way:
import styles from './ImageTextOption.module.css'
And use them like JS objects. However, now styles don't cascade from parent elements (that aren't defined in the same module). I had something like .selected .option-text
, and even though I do have selected
class outside, because option-text
has changed into a unique name it doesn't match the option-text
inside selected
element. What is the correct approach to get it matching again, using CSS modules.