News for hackers. Stuff that matters.
Re:Don't use Tailwind for your Design System by naasking on Wednesday January 11, 2023 @08:22AM (#34338088)
> At that point, you've just reinvented CSS classes.

Sort of, except instead of context switching between CSS, HTML, JS and your programming language, you can now remove the CSS entirely. Less context switching is good.

I'm a Tailwind fan and I don't see a problem with that pattern for some cases. Obviously there are better ways to organize that should be preferred in general, but it's fine to do that here and there.

Re:Don't use Tailwind for your Design System by arrow7000 on Wednesday January 11, 2023 @08:37AM (#34338237)
You still have to context switch between thinking about markup vs styling vs behaviour. The language you write the styling in barely makes a difference imo
Re:Don't use Tailwind for your Design System by naasking on Wednesday January 11, 2023 @08:58AM (#34338488)
Sure, but you don't have to switch between types of files, syntax, etc. "Barely makes a difference" seem subjective, so YMMV.
Re:Don't use Tailwind for your Design System by eckmLJE on Wednesday January 11, 2023 @09:06AM (#34338585)
Tailwind classes are a syntax (especially since you can set arbitrary values e.g. `top-[-113px]`) and they still represent CSS. So really you're using a DSL with its own syntax, functions and directives on top of the CSS you should still understand. The main benefit is speed: you have a library of utility classes that are shorthand for common CSS patterns. If you are pretending that you're not writing CSS, you are forgetting how the browser is actually working -- eventually you may have to leave Tailwind and you'll find you've forgotten how to write good CSS.