// styles.scss
.example {
}
render () {
return <div className={styles.example}></div>
}
When .example is empty, styles.example will become undefined.
How to avoid this? since I don't need to set styles to .example right now, but have to override its styles somewhere else, so I need to get a dedicated class name.
Also reported in https://github.com/css-modules/css-modules/issues/140
What should it generate? I wonder if this a spec issue.
It should be Card__example if the localIdentName=[name]__[local], but got undefined
I think empty string would be fault tolerant, but depends on whether you want to strip unstyled classes or not
I want to keep the className because I want to override it somewhere else.
If you follow the chain of issues from the CSS Modules one, it turns out this is actually to do with SASS removing empty styles, which can be overridden with a comment - see https://github.com/sass/sass/issues/2069.
This is working fine for me if I use the mixin in that issue.
Most helpful comment
If you follow the chain of issues from the CSS Modules one, it turns out this is actually to do with SASS removing empty styles, which can be overridden with a comment - see https://github.com/sass/sass/issues/2069.
This is working fine for me if I use the mixin in that issue.