from Hacker News

Stop using Tailwind's utility classes in the HTML class attribute

by firstrowraver on 7/12/24, 6:20 AM with 3 comments

  • by langcss on 7/12/24, 6:44 AM

    You want to avoid duplication, usually. You can also do it by creating components in React (and other frameworks). Doing so keeps the style close to the component definition which I think is good: if your component is say a nav bar some of its appearance comes from how you nest flexboxes and some from the flexbox configuration. Why not keep that all together?
  • by throwaway4good on 7/12/24, 7:03 AM

    Isn't this the very point of tailwind? If you don't like it maybe just don't use tailwind.
  • by ragnarel on 7/12/24, 8:12 AM

    So what is the point of using Tailwind if you do not want to use its main feature?