Hacker News new | ask | show | jobs
by aidos 1694 days ago
Tailwind isn’t css in js. It’s just css. They’ve built endless css mini classes that effectively give you enhanced inline styles. So stuff like hover variations are possible by adding the class directly to your element.

You can use the just in time compiler to generate the classes on the fly rather than importing millions of them in as a style sheet. That’s js, but really it’s just a regex that scrapes things that look like tailwind class names from your html and generates those classes for you.

1 comments

Yes, I know that, but in the article the OP is loading CSS via JS.
Ah, gotcha, the theme stuff at the bottom? Yeah, I don’t like that myself. I’ve been there with materialui and it’s depressing seeing runtime css kill your js performance for absolutely no gain.