DEV Community

loading...

Discussion on: The tiniest CSS-in-JS solution for your open-source React components

Collapse
fkhadra profile image
Fadi Khadra • Edited

Nice one, I have the same thing with react-toastify and react-contexify. I wanted to provide a way for the users to load the style without importing the CSS.

I created a small CLI tool that generates a helper function to inject the minified css.
It's not perfect but it does the job really well, also it's not tied to react.

github.com/fkhadra/style2js

Edit: I've tried react-colorful, I'll definitely use it for the project I'm working on. Really neat 👌

Collapse
omgovich profile image
Vlad Shilov Author

Thanks for the kind words!
react-toastify is an awesome library!

The most difficult part of the migration to CSS-in-JS is a bundler configuration. I reached all of my goals by using Microbundle. Give it a try — I guess might cover your needs.