2 ms·
The React example seems like it should really be using Emotion or a similar library to make the separate CSS files go away. While it is bringing an extra librar
by crooked-v 8y ago
The React example seems like it should really be using Emotion or a similar library to make the separate CSS files go away. While it is bringing an extra library into things, there's several that have an identical basic API, so it's a fairly generic approach for React apps now.
- fastball 8y agostyled-components[0] or death. 0: https://www.styled-components.com/ https://www.styled-components.com/
- crooked-v 8y agoWhy that particular one?
- fastball 8y ago* CSS-in-JS * Written as actual CSS * Styles that are easily extended / composable Would be my main reasons for liking it.
- crooked-v 8y agoYou don't seem to have looked at Emotion, because the most basic parts of it are clones of those parts from styled-components functionality, with variance once you get into the extended API.
- fastball 8y agoI haven't. Not really sure why that matters though? I was highlighting styled-components as a much better way of handling styling in React compared to inline JSX styles or CSS files.
- jholman 8y agoIt matters because you replied to a comment about Emotion saying "styled-components or death". If you wanted to compare it to something other than what the parent comment was talking about, maybe you should have made your own comment thread, or been more clear, or something.
- fastball 8y agoYou're very right. I somehow missed the reference to Emotion in the OP.
- Gigablah 8y agoBecause then you might write "styled-components or Emotion" rather than "styled-components or death".