react-grid-system icon indicating copy to clipboard operation
react-grid-system copied to clipboard

Supports className using css modules

Open salatielsql opened this issue 5 years ago • 8 comments

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?

salatielsql avatar May 08 '19 19:05 salatielsql

What exactly is not working? If I do something like <Col className="bla"> it renders perfectly as <div class="bla">.

gerbenmeyer avatar May 11 '19 17:05 gerbenmeyer

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]">

salatielsql avatar May 12 '19 17:05 salatielsql

@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.

jsphstls avatar Jun 22 '19 20:06 jsphstls

also such problem. It's minor but irritating to the eye.)

vacoo avatar Aug 02 '19 02:08 vacoo

...so should we wait for some solution?

Serhiy-Holiaka avatar Mar 12 '20 18:03 Serhiy-Holiaka

Feel free to make a PR :)

gerbenmeyer avatar Mar 14 '20 13:03 gerbenmeyer

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?

gerbenmeyer avatar May 10 '20 14:05 gerbenmeyer

This is working for me 🤷

ayozemr avatar Oct 13 '20 22:10 ayozemr