3 ms·
TailwindCSS is really good for HTML template engines. The idea is that you can’t separate style from HTML anyways, e.g. certain layouts and widgets require you
by armchairhacker 5y ago
TailwindCSS is really good for HTML template engines.
The idea is that you can’t separate style from HTML anyways, e.g. certain layouts and widgets require you to use multiple HTML components instead of just styling a base component. Or even if they don’t require, it’s a lot more straightforward than using some obscure CSS hack or possibly unsupported new feature (centering one element in another comes to mind).
So instead of writing HTML directly and then styling it with CSS, you write HTML components and then reuse those components. Each component basically has its own style, and it’s a lot easier to just define it inline using TailwindCSS.
Another benefit of TailwindCSS is that it’s really concise and has automatic support for custom color palettes and size units. In React and Vue there are many ways to define inline styles, some with typing guarantees, but still Tailwind tends to be easier.