DEV Community

Discussion on: Can you sell me Tailwindcss over Styled Components?

Collapse
 
drews256 profile image
Andrew Stuntz

Is it only made for people who never used css before?

Definitely not!

Is it going to replace styled-components in the future?

I hope so. In your example, where are your styles? S.Box? What is that? What happens if you need to change that here, or in a different component.

Also, you can use tailwind in your css using the provided @apply directive and build out classes much as you'd like.

There is a lot more flexibility with individual components when using Tailwind.

Rather than applying CSS with a selector, then overriding it with a more specific selector to change it to work slightly differently when you need to "reuse" your component, you know exactly what the component should look like when it's rendered out, just by looking at the classes.

Also your example assumes you're using JSX which is definitely not always the case.