MathiasGilson / Tailwind-Styled-Component

Create Tailwind CSS React components like styled components with class names on multiple lines and conditional class rendering
MIT License
818 stars 43 forks source link

Add CSS to tailwind styled component #68

Closed aidan-rypens closed 2 years ago

aidan-rypens commented 2 years ago

Is it possible to add CSS to a tailwind styled componet (not extend)? Combining both CSS and tailwind classes would be nice!

MathiasGilson commented 2 years ago

No because tailwind properties are actually CSS classes and CSS pure css would be CSS properties which are not compatible.

It would require extracting the CSS properties out of the tailwind class names.

You can submit a PR but I feel that extending a custom styled component is the cleanest way to do it.

aidan-rypens commented 2 years ago

Thanks for following up!

Yes, but sometimes not everything is do-able with tailwind and doing it with an extend takes a bit of the 'cleanliness' away in my part as you have a few extra lines and not have sort of a quick view of the actual generated css.

But thanks for having a look. Maybe it is just my way of working and not everyone's problem.