react-grid-system
react-grid-system copied to clipboard
Supports className using css modules
Hi! I don't know if you library needs to add support to css module but when I try to use something like this:
<Col sx={12} sm={4} className={styles.col}>
...
</Col>
It doesn't work. Is this something in your plans?
What exactly is not working? If I do something like <Col className="bla">
it renders perfectly as <div class="bla">
.
If I do <Col className={styles.customClass}>
when it renders I got only <div>
without the class.
Also I use a webpack/postcss config to create a hash after my classes so I was expecting to write <Col className={styles.customClass}>
and get something like this in the html:
<div class="customClass_[HASH]">
@gerbenmeyer the question is about CSS modules instead of static string classNames. I have not yet tried it myself but it sounds like the dynamically generated classNames that result from importing CSS modules are not surviving Webpack.
also such problem. It's minor but irritating to the eye.)
...so should we wait for some solution?
Feel free to make a PR :)
Any idea already why the classNames aren't surviving Webpack? And would this be solvable by a component decorator approach like proposed in https://github.com/sealninja/react-grid-system/pull/107?
This is working for me 🤷