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

> Is something that can be easily achieved with Tailwind without either using @apply all over the place, effectively now doing regular old CSS but with Tailwind syntax, or by using JS/TS variables extensively making the styling pretty hard to read.

Define an html component, say MyButton:

    <button class="h-8 other-inline-styles-here">{MyButtonText}</button>
And use that component everywhere and the styles carry through:

   <MyButton MyButtonText="Click here!" />
People worry about regurgitating the same CSS with Tailwind, while continuing to regurgitate the same HTML structures all over the place. Encouraging inline styling encourages you to stop repeating your HTML, which is a better approach, even for a design system.


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: