3 ms·
Nice project! We have a project like that one of our developers wrote except it will compile the classes back to a CSS stylesheet for you for performance and w
by inglor 10y ago
Nice project!
We have a project like that one of our developers wrote except it will compile the classes back to a CSS stylesheet for you for performance and will unify identical styles to not have duplicates and save space https://github.com/Mosho1/react-style https://github.com/Mosho1/react-style
- casesandberg 10y agoSo it translates everything back to CSS, is that how it handles hover and pseudo classes?
- inglor 10y agoYes, exactly - it also produces smaller file sizes and in our experience it's faster. It's also nice to be able to use classes and integrate with CSS seamlessly when you need to.
- casesandberg 10y agoIs it possible to use state or props in the CSS though? How does it handle that? Say I wanted the color of a title to be controlled via props, how would I do that with your solution?
- daok 10y agoOne advantage to keep the style not in a CSS file is that you can handle dynamic value easily withing your component. Bringing back to a CSS file make you loss that capability.