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

Agreed, I find tailwind defaults sensible, but it tends to make templates quite unreadable.

My compromise with it is just using @apply in css files:

styles.css:

.button { @apply px-2 py-1 rounded-sm shadow-md hover:shadow-lg font-bold cursor-pointer block; height: 32px; }

.button.create { @apply bg-green-700 text-white; }

template.html:

<button class="button create">...</button>



Ah the dream. Only now it takes my django project 45s to rebuild the tailwind any time I change those styles (and I only have about 30).


For me it's just a few seconds, but my css needs are rather compact. Luckily I don't have to change styles daily though.




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

Search: