Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Also a Tachyons fan. I looked at TailwindCSS, but stopped at the installation section. The recommended path to get it working with Create-React-App is to install a bunch of JS packages (PostCSS, autoprefixer) and to layer on another tool over CRA (craco)? No thanks, I'd rather just <link> tachyons.min.css and move on.


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.


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....


Wouldn't that be necessary for tree shaking? Including the entire stylesheet would add considerable overhead to your production site.


It's a shame that the Tailwind docs recommend to use craco. I think that's a major turn off. In that situation, I rolled my own npm-run-all customizations of the default scripts for start and build. It's extra noise but less than the documented approach.


Author here, I am eagerly awaiting the next version of Create React App. I'm hoping the upgraded internals will remove the need for CRACO. Here's a link to CRA v5 on Github:

https://github.com/facebook/create-react-app/milestone/81?cl...


I've used it with other tools / frameworks like Vite or Svelte; it's pretty agnostic. Plus setting it up is a one time thing.




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

Search: