4 ms·
CSS modules solves all of these problems (except the separate file), and also lets you write vanilla CSS, and not have to hack around the limitations of css-in-
by stevebmark 5y ago
CSS modules solves all of these problems (except the separate file), and also lets you write vanilla CSS, and not have to hack around the limitations of css-in-js. Dynamic styles are easy with React's `css` prop, or simply passing in an additional class name.
- mikewhy 5y agoReact doesn't have a CSS prop.
- frank_nitti 5y agoMust be referring to the style prop for jsx elements whose argument conforms to the React.CSSProperties interface
- mikewhy 5y agoHard to say, for instance the very popular styled-components package does add a `css` prop magically to all elements.
- girvo 5y agoI think they've assumed `styled-components` is default?
- hudixt 5y agoAdded one more point on API. Also, you'll probably end up using one more library called classname for better classname management. https://www.npmjs.com/package/classnames https://www.npmjs.com/package/classnames In the end, I generally prefer to use tailwind + emotion. My goals usually is to save time and make system more consistent rather than perf gains, which isn't that much on new systems.
- nicoburns 5y agoIndeed. Worth noting that classnames is a tiny library.