Comment

Comment by commotionfever

this isn't how Tailwind is supposed to be used. you abstract at the level of components, not class names. <Button /> instead of <button class="btn">

then, inside your Button, you get a small bit of markup and your class names. makes it easy to see which markup gets which styles

that's also why the other discourage use of @apply, and why "ugly HTML" is rarely am issue. at least not in my experience

---

that said, if you're using Tailwind in an environment where there's no components, fragments, partials, whatever - then this might make sense

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton