Hacker News new | past | comments | ask | show | jobs | submit login

People here are complaining about how Tailwind is annoying because the className strings are too long. The correct solution is to write a quick 1-file helper.

See: https://gist.github.com/vedantroy/80fb2feb21b07b6f53032b8725...

I wrote that. It allows me to do stuff like:

    const Button = tw.div(`
        bg-blue-500
        rounded
    `)
Any complaint about how tailwind forces overly long class names should probably look at this comment first.



I’m not sure if JSX supports it but Vue templates and of course just regular old HTML allows a class to span multiple lines anyway. It doesn’t all have to be on one huge line.




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

Search: