News for hackers. Stuff that matters.
Re:Knowing CSS is mastery to Front end Development by Zardoz84 on Sunday March 02, 2025 @06:30PM (#43236442)
> Like imagine your company’s main “button” element. It’s got 8 different sizes, optional icons on both sides, animations, styles, each needing to support different color combos. Tailwind is miserable for that. You get giant huge balls of spaghetti classes all over your button, and it’s pretty incomprehensible.

.brand-btn {}

.brand-btn--inverted {}

.brand-btn--icon-right {}

.brand-btn--smaln {}

.brand-btn--smaller {}

.brand-btn--big {}

<button class="brand-btn brand-btn--icon-right brand-btn--small brand-btn--inverted" />

However, very rarely need too many combinations of the same button with a brand logo.

Re:Knowing CSS is mastery to Front end Development by meerita on Tuesday March 04, 2025 @05:13AM (#43252716)
We don't develop without components anymore.

You can have a nice component with all the cases, type-safe, and apply few utility classes to produce more maintainable code.