4 ms·
Slightly OT: anyone can recommend a tool that turns the tailwind class mess into a properly structured CSS file (Grouping common utility classes etc). I think
by ToJans 3y ago
Slightly OT: anyone can recommend a tool that turns the tailwind class mess into a properly structured CSS file (Grouping common utility classes etc).
I think I'd pay for this if it works properly...
- ToJans 3y agoJust an example of code that drives me nuts: <button type="button" className={clsx( checked ? "border-2 border-primary-800" : "", "flex touch-none flex-col items-center justify-between rounded border border-gray-100 bg-white hover:border-2 hover:border-primary-800", )} >
- hirako2000 3y agoafaik Tailwind determine classes to produce at runtime. You are likely out of luck there, who would want to turn this into a compile time approach, would rather write a new css library.
- kaba0 3y agoThat’s just to save space. You can actually produce a complete, static CSS file that contains every class. Also, the “dynamic” nature is almost as simple as a regex - you don’t have to do complex static analysis which of the branches are taken, etc, you just include every className and that’s it.
- hirako2000 3y agoI didnt know the entire class set could be produced. Thanks for sharing