I'm using css modules and I have a React component with two classes:
<div className={`${styles.hashedClass} clear-class`}>
qwerty
</div>
my scss file looks like this and it is not working.
.hashedClass {
...
&.clear-class {
background-color: green;
}
}
when I looked into the source with dev tools I noticed clear-class is getting hashed too.
Is there a way to mark in scss file that I want to apply styling to not hashed class?
Use :global()
selector in class you don't want to hash
.hashedClass {
...
& :global(.clear-class) {
background-color: green;
}
}