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

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



> why "ugly HTML" is rarely am issue. at least not in my experience

Fascinating, 5/5 Tailwind projects I have ever used, from YC companies to multibillion dollar private companies have had "ugly HTML". Not every single HTML element is a component, and top levels of components still need to by styled using tailwind's long lists of classes.




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

Search: