Hacker News new | ask | show | jobs
by brightball 1683 days ago
As much as I hate JS packages, when I read why Tailwind is built the way it is…it made a lot more sense.

You basically generate the kitchen sink in dev and then rip out everything you’re not using when it’s deployed so the actual package size is really tiny.

2 comments

Author here, while it's not the default, newer versions of Tailwind have an experimental Just In Time mode, which inverts the approach to generate styles as you type them rather than upfront. Using JIT has greatly sped up my development workflow. Changing the config is significantly faster than in normal mode.
Compared to Tachyons being tiny by default and you just add anything else you need in another CSS file. It's just another CSS file, why is the 'Tailwind way' so averse to using custom CSS? Instead it includes every style by default and uses a javascript build step to strip out the unnecessary styles, good grief.

Utility CSS classes should augment your CSS, not be your entire CSS.

This is changing with v3 that is slated to be released before the end of the year. The JIT compiler for Tailwind is becoming the default now that it has had a year+ to bake in the wild and prove itself as reliable.

As far as the toolchain goes, meh. Building on PostCSS allowed the Tailwind team a lot of power with minimal complexity and it appears to have paid off for them. The JIT is plenty fast as is now; so fast in fact, that you can now run it in on a CDN build for prototyping/MVP.

https://github.com/tailwindlabs/tailwindcss/releases/tag/v3....