News for hackers. Stuff that matters.
Re:Tailwind CSS v4.0.0 Alpha by kingofthehill98 on Wednesday March 06, 2024 @12:37PM (#39618486)
Tailwind is the second best thing ever happend to frontend, only Vue 3 tops it.

Not having to come up with names for CSS classes, no duplicated CSS code, no fighting conflicting classes, everything in one file, being able to visualize a component just by reading the code... it's a godsend. I'll never go back to SCSS unless work obliges me.

Vue 3 with <script setup lang="ts">, TailwindCSS and Vite. The way God intended.

Re:Tailwind CSS v4.0.0 Alpha by troyvit on Wednesday March 06, 2024 @01:49PM (#39619565)
The first time I saw tailwind I almost threw up in my mouth because it broke so much I hold dear about CSS. A few weeks later I went to their site being all wtf is going on here, and I saw this quote on the front page from its creator:

> If you can suppress the urge to retch long enough to give it a chance, I really think you’ll wonder how you ever worked with CSS any other way.

Now I'm going to try it.

Re:Tailwind CSS v4.0.0 Alpha by corytheboyd on Wednesday March 06, 2024 @02:58PM (#39620577)
Please do try it, it really does speed things up if you care enough to learn it. IDE integration is a must. A lot of people seem to try it for five minutes, then conclude with absolute certainty that “this sucks” which is very annoying. If you like building good web views fast but don’t care enough to learn the massive core of css (or some hot new js-to-css-or-whatever tool) then tailwindcss is perfect. I build web views every now and then, but it’s not interesting to me, I want to rabbit hole on the real issues, which usually reside elsewhere. Also, I learned it years ago, and that knowledge is still useful, can’t say that about most web tech :)
Re:Tailwind CSS v4.0.0 Alpha by aaronbrethorst on Wednesday March 06, 2024 @02:12PM (#39619932)
I hated Tailwind for the first week I used it, and couldn’t imagine working without it by week two.
Re:Tailwind CSS v4.0.0 Alpha by drivingmenuts on Wednesday March 06, 2024 @10:47PM (#39624865)
I’ve tried it - I’m just too used to working with Bootstrap.
Re:Tailwind CSS v4.0.0 Alpha by 0xblinq on Friday March 08, 2024 @01:22AM (#39638334)
They're different things IMHO.

Bootstrap gives you a pre-made look and feel that you can use despite knowing CSS or not and maybe you can customize a bit, make a theme, etc. Bootstrap is more like "Tailwind UI" which is different thing from Tailwind (the tool).

To use plain Tailwind (without Tailwind UI) you do need to know CSS. It's just like a "CSS-in-JS" tool, except it's "CSS-in-HTML" this time.

Re:Tailwind CSS v4.0.0 Alpha by tiew9Vii on Wednesday March 06, 2024 @08:41PM (#39624140)
Similar feelings.

It goes against semantic web, the old css zen garden etc, with good markup I can style a page however I want.

However using tailwind, it’s the get shit done tool. It is ugly, it goes against good web design and everything I believe makes good web design but it works fantastically well in practice.

I dislike using tailwind, at the same time I will choose to use tailwind without hesitation as it makes up process a lot less friction and avoids selector conflicts.

Re:Tailwind CSS v4.0.0 Alpha by Sateeshm on Wednesday March 06, 2024 @11:38PM (#39625103)
I was one of those who resisted. Now I won't not use tailwind if I have a choice. The best thing about it is I feel like I'm still writing vanilla CSS, just in a different way.
Re:Tailwind CSS v4.0.0 Alpha by 0xblinq on Friday March 08, 2024 @01:20AM (#39638318)
I think it's been the same situation with React. Everyone hated JSX when it first came out, then people realized the benefits outweigh the drawbacks.
Re:Tailwind CSS v4.0.0 Alpha by Rapzid on Wednesday March 06, 2024 @01:51PM (#39619599)
> Not having to come up with names for CSS classes

As soon as you want theming you'll need to start naming stuff. And if you want that theming to support third-party CSS overrides, or need good CSS selector support, you're going to be back to needing to name classes again.

Not everyone needs that, and that's fine. But there are plenty of people working on products and in environments where the Tailwind way is not going to be the path of least friction.

I would actually say StoryBook, or the StoryBook pattern at least, has been a much greater boon on FE development over the last decade.

Re:Tailwind CSS v4.0.0 Alpha by braden-lk on Wednesday March 06, 2024 @06:13PM (#39622987)
A nice thing about tw is you can set your colors, paddings, etc, to resolve to CSS variables. That + some tweaks to the tailwind config, you get a nice themeable setup that doesn’t deviate too far from vanilla tailwind, imo.
Re:Tailwind CSS v4.0.0 Alpha by gedy on Thursday March 07, 2024 @01:16PM (#39632516)
Somewhat - but when your theme change does things like "buttons are now green outlined rectangles instead of blue filled rounded corners", Tailwind shows its weaknesses.

DaisyUI on top of Tailwind helps, but then you may as well use Bootstrap and get better component support.

Re:Tailwind CSS v4.0.0 Alpha by balls187 on Wednesday March 06, 2024 @12:43PM (#39618545)
Have you tried Svelte?
Re:Tailwind CSS v4.0.0 Alpha by blackbeans on Wednesday March 06, 2024 @12:56PM (#39618720)
It's slightly more convenient, but Vue3 is already great. I like to support an ecosystem and I want a framework to keep existing, making sure I can maintain my projects in the future. That is why I don't jump ship.
Re:Tailwind CSS v4.0.0 Alpha by kingofthehill98 on Wednesday March 06, 2024 @12:47PM (#39618591)
I have, it's just as good if not a tad better, but I'm so comfortable and productive with Vue and they're so similar that it's just not worth switching. I'm also very familiar with the Vue ecosystem, so anytime I need a library or plugin I know exactly what to pull.
Re:Tailwind CSS v4.0.0 Alpha by Keyframe on Wednesday March 06, 2024 @01:44PM (#39619493)
Nothing against you, but I swear Svelte is Rust of frontend tech. Whatever the topic, it always pops up out of nowhere.

idiot edit: not React, Rust.

Re:Tailwind CSS v4.0.0 Alpha by pcthrowaway on Wednesday March 06, 2024 @02:21PM (#39620061)
Svelte pops up out of nowhere because people tend to really love it. Not sure how it's the "React of frontend tech" since React is a competing frontend framework (which is now moving to adopt a Svelte-like compiled approach).

I haven't used Vue (any version) so this wouldn't be the place I'd normally chime in about Svelte. People seem to love Vue as well.

Re:Tailwind CSS v4.0.0 Alpha by Keyframe on Wednesday March 06, 2024 @02:53PM (#39620512)
I'm an idiot. I meant Rust :) Where people are enamored with tech enough to evangelize whenever and wherever they can on their own.
Re:Tailwind CSS v4.0.0 Alpha by balls187 on Wednesday March 06, 2024 @03:47PM (#39621219)
That, but also because you interpreted a question to be a form of generalization.

The great thing about HN is you can easily see a users comments.

Re:Tailwind CSS v4.0.0 Alpha by pcthrowaway on Wednesday March 06, 2024 @05:09PM (#39622346)
Interesting take. I get why people writing a certain class of programs love Rust, but I can assure you Svelte doesn't do much to ensure correctness of the front-end app. It's just way more ergonomic than React for the vast majority of small to mid-size projects, and probably large projects too.

Rust is also about 100X as difficult to learn as Svelte (assuming you have basic familiarity with front-end dev), and easier to learn than React as well. Speaking from personal experience.

Re:Tailwind CSS v4.0.0 Alpha by cqqxo4zV46cp on Wednesday March 06, 2024 @06:30PM (#39623147)
You are discussing attributes of Rust that GP did not intend to compare with Vue. They are talking about the evangelistic user base.
Re:Tailwind CSS v4.0.0 Alpha by fngjdflmdflg on Wednesday March 06, 2024 @05:01PM (#39622244)
>which is now moving to adopt a Svelte-like compiled approach

Interesting. Is there a page where I can read more about this and the current progress?

Re:Tailwind CSS v4.0.0 Alpha by pcthrowaway on Wednesday March 06, 2024 @05:10PM (#39622355)
Re:Tailwind CSS v4.0.0 Alpha by rimunroe on Thursday March 07, 2024 @03:01AM (#39626394)
> React is a competing frontend framework (which is now moving to adopt a Svelte-like compiled approach)

React has been moving in the direction of a compiled approach for over seven years now[1], predating Svelte’s first release. The introduction of hooks in 2018 grew out of early efforts on an optimizing compiler. Those earlier efforts were hampered by class semantics making things like constant folding across components difficult. React Forget seems like a predictable progression from there.

[1] https://github.com/facebook/react/issues/7323

Re:Tailwind CSS v4.0.0 Alpha by gedy on Wednesday March 06, 2024 @01:01PM (#39618793)
In all fairness you are comparing a framework vs no framework. I'd for sure take TW over nothing, but there are other frameworks too.
Re:Tailwind CSS v4.0.0 Alpha by Blaiz0r on Wednesday March 06, 2024 @01:03PM (#39618806)
Has Hackernews really devolved into this dogmatic nonsense?
Re:Tailwind CSS v4.0.0 Alpha by Aerbil313 on Wednesday March 06, 2024 @01:10PM (#39618932)
Yep. I like Tailwind, one can list the benefits and say he likes it but GP's comment surely could be less full of zealotry.
Re:Tailwind CSS v4.0.0 Alpha by h4ch1 on Wednesday March 06, 2024 @12:47PM (#39618602)
God then came forth yet again and blest us with Svelte. The devil then appeared and introduced runes
Re:Tailwind CSS v4.0.0 Alpha by diggan on Wednesday March 06, 2024 @12:51PM (#39618642)
Maybe we should start to treat this like the yearly hardware releases? Buy one generation, skip the next, buy the next...

So if you're on the vue-wagon, skip svelte and wait until the next "The way God intended". If you're on svelte now, skip the next "The way God intended" and then after that, jump on the new wagon.

Re:Tailwind CSS v4.0.0 Alpha by the__alchemist on Wednesday March 06, 2024 @01:04PM (#39618825)
Typescript + direct DOM manipulation + HTML + CSS 4 lyfe! Fight me.

Helper functions like createEl(tag, attributes, style, text) help...

Re:Tailwind CSS v4.0.0 Alpha by diggan on Wednesday March 06, 2024 @01:21PM (#39619104)
TypeScript is my "skip X" phase, I'll wait for the next compile-to-js language which better be a dynamic one again. Hopefully something in the lisp direction instead of the opposite like TypeScript. JavaScript deserves to be free of its shackles.
Re:Tailwind CSS v4.0.0 Alpha by Volundr on Wednesday March 06, 2024 @03:31PM (#39621019)
ClojureScript has entered the chat...
Re:Tailwind CSS v4.0.0 Alpha by diggan on Thursday March 07, 2024 @08:33AM (#39628839)
Yeah, something like that, but written from the ground up with closer JavaScript interop and made for writing UIs :)
Re:Tailwind CSS v4.0.0 Alpha by kingofthehill98 on Wednesday March 06, 2024 @12:54PM (#39618680)
That was kind of my story lol

I was heavily into full-stack SSR frameworks + jQuery, then Angular and React came along and I was like "oh heaven, is this were we headed?", ignored both of those for years and finally found peace in the sacred words of Evan You.

Re:Tailwind CSS v4.0.0 Alpha by ehutch79 on Wednesday March 06, 2024 @12:57PM (#39618732)
Coming up with css class names is not hard. And if you're that creatively inhibited to not come up with the class name 'pricing-card' for cards in the pricing table, there's crutches like BEM ( https://getbem.com/introduction/ )
Re:Tailwind CSS v4.0.0 Alpha by AlchemistCamp on Wednesday March 06, 2024 @01:04PM (#39618824)
BEM was great, for the early to mid 2010s. Utility classes have still been a big productivity win for me.

Working on an app with a great deal of technical debt last year, moving to Tailwind made a world of difference in being able to restyle components without also breaking styles on distant parts of the app that nobody on the team realized were relying on the same styles.

Re:Tailwind CSS v4.0.0 Alpha by ehutch79 on Wednesday March 06, 2024 @02:09PM (#39619887)
Utility classes are good and all. Scoped css is great.

"Naming things is hard" is still such a cop-out.

Re:Tailwind CSS v4.0.0 Alpha by reidjs on Wednesday March 06, 2024 @02:46PM (#39620406)
You can still name things when it makes sense, I just like that in tailwind I don't have to name ALL of the things. It's nice to be able to easily add some margin, or padding, or a few style properties to an element, instead of coming up with a name AND adding those properties in a separate file.
Re:Tailwind CSS v4.0.0 Alpha by cqqxo4zV46cp on Wednesday March 06, 2024 @06:37PM (#39623218)
“Naming things” being one of the two / three hard problems in software development is literally a meme. They didn’t pull it out of thin air.
Re:Tailwind CSS v4.0.0 Alpha by scotty79 on Wednesday March 06, 2024 @10:23PM (#39624738)
You could say the same about style="" attribute and !important

Mess is still mess even if you are making it through a framework.

Re:Tailwind CSS v4.0.0 Alpha by kingofthehill98 on Wednesday March 06, 2024 @01:00PM (#39618777)
It's not exactly easy either.

In the end I'll be writing <PricingCard :price="product.price" /> anyway. All that Tailwind garbage will be nicely hidden inside the component.

Re:Tailwind CSS v4.0.0 Alpha by ehutch79 on Wednesday March 06, 2024 @02:07PM (#39619870)
That's fine. Saying it's redundant is 100% valid. That's not what the OP said.

Saying it's because naming a class is hard is BS.

Re:Tailwind CSS v4.0.0 Alpha by Yiin on Wednesday March 06, 2024 @02:25PM (#39620117)
Re:Tailwind CSS v4.0.0 Alpha by isleyaardvark on Wednesday March 06, 2024 @07:25PM (#39623597)
I need to bookmark that link, it's perfect.
Re:Tailwind CSS v4.0.0 Alpha by 0xblinq on Friday March 08, 2024 @01:26AM (#39638355)
And in practical real life terms (where teams and long term projects and people coming and leaving the team over years and different skill levels, etc) is how CSS becomes a write-only mess.

Tailwind is primarily a way to do "css-in-js", except it's "css-in-html". It might not look nice on the eye but it's fucking easier to maintain, safer to remove, etc. As long as you have a way to create "components" you're fine.

> Coming up with css class names is not hard.

Yes, unless you work alone on your tiny 2 weeks old side project, it's fucking hard.

Re:Tailwind CSS v4.0.0 Alpha by petre on Wednesday March 06, 2024 @05:08PM (#39622333)
Too bad the buttons come out with transparent background. I gave up and used boostrap 5, since I had to actually get work done instead of reading github issues.
Re:Tailwind CSS v4.0.0 Alpha by cqqxo4zV46cp on Wednesday March 06, 2024 @06:31PM (#39623162)
What? It doesn’t sound like you actually looked at the premise of Tailwind in the first place. It does not come with pre-canned components. This is clearly user error.
Re:Tailwind CSS v4.0.0 Alpha by petre on Thursday March 07, 2024 @12:09AM (#39625269)
Sure. The "solution" is to disable preflight or override its styles. Also, this happened on a from scratch codebase without any funny css.

https://github.com/tailwindlabs/tailwindcss/issues/6602