News for hackers. Stuff that matters.
Re:Tailwind V4 Is Finally Out by throwup238 on Thursday January 23, 2025 @01:23AM (#42801235)
One of the reasons Tailwind became so popular - even more so than preceding frameworks like Bootstrap - is that a lot of people who normally liked working with CSS directly fell in love with it. It removes the extra step of editing a separate CSS file without straying far from a 1:1 mapping and eliminates most of the cascading rules that have plagued frontend for decades (`group:` and friends notwithstanding). The latter is important when working on large teams because it eliminates the name bikeshedding and conflicts.
Re:Tailwind V4 Is Finally Out by agos on Thursday January 23, 2025 @05:36AM (#42802684)
sorry, but this is just not true. The cascading issue is still there, and it gets even worse because if you have an element with class "p-1 p-0" you cannot know in advance which will take precedence.

Of course you shouldn't do that, but it happens to be the case that Phoenix does exactly that

Re:Tailwind V4 Is Finally Out by Lockal on Thursday January 23, 2025 @07:03AM (#42803189)
You suddenly reminded me about another good Tailwind thing: linter will highlight "p-1 p-0" as a mistake. I've never seen linters that warn on "your-custom-p1 your-custom-p0", but Tailwind makes it possible.
Re:Tailwind V4 Is Finally Out by ahofmann on Thursday January 23, 2025 @06:25AM (#42802962)
This is not a cascading issue. This is a "You're holding it wrong" issue. And when Phoenix does write 'p-0 p-1', Phoenix and Tailwind are not a good match.
Re:Tailwind V4 Is Finally Out by isleyaardvark on Thursday January 23, 2025 @12:11PM (#42805801)
If the alternative is:

.foo { padding: 0; padding: 1rem; }

then I can see the precedence but I don’t see how it’s an advantage. You can write bad code in any methodology.

That seems like an issue with Phoenix and not Tailwind or the Tailwind approach.