I'm using scss modules in next.js and want to use nested class selectors like this:
.div {
.x {
color: red;
}
}
But it seems that this won't work with the following component:
import React from 'react'
import styles from './my-component.module.scss'
export default class MyComponent extends React.Component {
public render() {
return (
<div className={styles.div}>
<span className='x'>ololo</span>
</div>
)
}
}
For some reason, the styles do not apply to the <span>
tag.
Whats wrong with this code?