Hacker Newsnew | past | comments | ask | show | jobs | submitlogin



Yep, happily using css modules too.

The only tiny issue left with that approach is that you still can't share code (for instance, colors) between JS & CSS.

but overall, I think it's the best compromise today.


Look at css-module-values [0]. It's not perfect, but it lets you share values between JS and CSS. All values in the file are visible on the imported module.

[0] https://github.com/css-modules/postcss-modules-values


Thanks, looks handy!


Nice.

I've tried a few solutions to add styles to React components but they all had something that didn't make them see as the perfect solution.

This looks very good, I've never tried it before.

Thanks.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: