5 ms·
personally I find tailwind to be atrocious looking and can't understand anyone preferring it to styled-components
by lancemurdock 5y ago
personally I find tailwind to be atrocious looking and can't understand anyone preferring it to styled-components
- 01brett 5y agoAuthor here, I haven't had time to play around with it, but this library[0] from Atlassian looks like a "best of the both worlds" styling approach: CSS-in-JS authorship without the runtime penalty. [0] https://compiledcssinjs.com/ https://compiledcssinjs.com/
- bezieio 5y agoIf you like the idea of tailwind and don't want to look at utility classes and still want the power of styled-components or react-emotion I'd check out Chakra UI [0]. [0] https://chakra-ui.com/ https://chakra-ui.com/
- 01brett 5y agoChakra is excellent. I recommend it for any React devs considering Bootstrap. It's doubly useful if you don't have a designer.
- Vinnl 5y agoThe tooling is much less intertwined with other tooling and therefore less likely to cause problems, and the runtime performance impact is less. That's pretty neat.
- deleted 5y ago[deleted]
- VWWHFSfQ 5y agoagree. I don't understand this fad at all.
- lancemurdock 5y agothe syntax of styled-components plays so nicely with actual reusable components. A mesh of tailwind syntax with reusable components feels weird. But mostly, a div with 10 classes each doing one small thing is so unreadable
- reidjs 5y agoIn our codebase when it starts getting out of hand like that, we refactor using @apply https://tailwindcss.com/docs/extracting-components https://tailwindcss.com/docs/extracting-components
- neurotrace 5y agoIf you're using `apply`, you might as well have just written the CSS normally, imo
- kaishiro 5y agoI doubt the parent is talking about applying each of the tailwind util classes directly, but instead wrapping that combination of classes up into a reusable component to be applied around.
- neurotrace 5y agoThey're talking about the @apply directive. It takes a list of classes and creates a single class with those properties. Since Tailwind classes generally map almost 1-to-1 for CSS rules, it'd be easier in my opinion to just write the CSS directly.
- kaishiro 5y agoI'm fully aware of what they're talking about. It's common usage in Tailwind to extract large collections of the utility classes back into reusable component classes which can be applied with a single @apply directive [1]. This being the case, this would not be a 1-to-1 mapping at all. [1] https://tailwindcss.com/docs/extracting-components https://tailwindcss.com/docs/extracting-components