Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is specifically what they tell you not to do.

https://tailwindcss.com/docs/reusing-styles

Their advice is to use templating (components, partials, loops) to abstract and I agree. It ends up working a lot better than abstracting your CSS.



I am sorry I should have written it better. This is how I abstract away from tailwinds utility litter.

https://tailwindcss.com/docs/reusing-styles#extracting-class...


Further down in the link they do talk about not doing this for everything. Only for small things when templates are too much.

"Whatever you do, don’t use @apply just to make things look “cleaner”"


It is in general good CSS advice not just specific to apply.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: