I like most HN threads but anything frontend is laughed at by people with little frontend experience. They repeat some truth they learned 20 years ago.
Honestly HN is not a good place to discuss frontend stuff. You will only see "get off my lawn" kind of comments.
1. I have a passion for front end, I have a PhD in Human Computer Interaction.
3. I am the cofounder and CTO of a company whose main product is based on CSS-in-JS (Emotion, Chakra UI)
2. I really like Tailwind and used it on several production projects.
4. So I know very well both of these approaches. I know their advantages and drawbacks.
5. In my comment I state the sad truth about this particular project: It combines the worst of both approaches in terms of performance, without any added value as compared to these approaches. Slow build AND slow runtime, without any added modularity.
This approach is objectively bad and this is why people react like this.
And to be constructive: If you want to use tailwind, use tailwind and you will have performant runtime but less customizability. If you want to use CSS-in-JS, use it and you will have customizability, but slower runtime. Engineering is trade-offs, but twin is still the worst of both worlds.
You can absolutely do that with CSS (and some people probably did for years), but having theses classes already available kind of shows you the way.
Like it or not, Tailwind (and things that help people use Tailwind) serves a very valid niche. Unwrapping years of legacy CSS, intertwined with CSS injection in jQuery, is no simple feat. Adding Tailwind to that project and only writing Tailwind has helped immensely.
The downside is that there are times when you have a really long list of classes on a given tag, which can be difficult to read and parse. I’m not sure if this tool is right for me or my team, but that’s one use case I could see for using it.
Are we really complaining about emojis in READMEs nowadays? Good grief.