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

Will this work with purge css? #57

Closed vedantroy closed 2 years ago

vedantroy commented 2 years ago

I know tailwind css detects whether a class is used based on className. Since components defined using this format are not using className, will the resulting css file still include the correct class names?

randallmlough commented 2 years ago

Yes. Tailwind's purge mechanism reads the whole file not just what is defined in <div className='some-class'> for example

vedantroy commented 2 years ago

Oh that's quite nice, are there docs on how this works?