News for hackers. Stuff that matters.
Re:Play with TailwindCSS in the Browser by gedy on Friday June 10, 2022 @10:41AM (#31694873)
I really like utility classes and think Tailwind is really smart for many usecases, but the drawback with Tailwind is even if you componentize, your code is sprinkled with very specific visual classes like for shadows, border radius, etc. When companies want to refresh their look and feel, it's really annoying to change everything to remove now unwanted shadows, etc. In spite of it's age, I've found Bootstrap is better for this as it uses predefined component classes that can be restyled without rewriting the app or components (but also has some handy utility classes).

I know you can define your own component classes in TW, but then you've just recreated Bootstrap/Bulma/etc, but with no 3rd party components available. (Tailwind UI is just some limited copy paste code snippets last I looked.)

Re:Play with TailwindCSS in the Browser by bpicolo on Friday June 10, 2022 @10:48AM (#31694981)
> but with no 3rd party components available

There are a bunch of great 3rd party components available in tailwind now. https://daisyui.com/ is one I've been using. They're usually a tad bit lower level than typical framework component libs, but the flexibility is great.

A great thing about that is they're not React-specific, Vue-specific, etc. You can use them in everything from raw html to your JS library flavor of choice.

Re:Play with TailwindCSS in the Browser by gedy on Friday June 10, 2022 @11:19AM (#31695394)
DaisyUI is a nice approach and hope it succeeds. We were looking to use that until we realized it's almost identical to Bootstrap, and that we were just using Tailwind as an elaborate way to make a custom Bootstrap theme at build time. Company decided to go with BS5 instead.
Re:Play with TailwindCSS in the Browser by likortera on Friday June 10, 2022 @10:52AM (#31695039)
Have you ever had to change the company's look and feel with anything else than tailwind?

I had to do it with a BEM codebase, and I also had to do it with tailwind. The tailwind situation was by far the easiest one. And it was because I was not afraid to remove things that could break unrelated parts of the application. Not allowing developer to hand write CSS is a great restriction for a good bunch of developers. The messes out there are unbelievable.

Re:Play with TailwindCSS in the Browser by calvinmorrison on Friday June 10, 2022 @11:37AM (#31695647)
> Have you ever had to change the company's look and feel with anything else than tailwind?

Yes, many times, with normal CSS. It's basically the point of cascading style sheets. Sticking to proper class names and elements makes reskinning a breeze.

Re:Play with TailwindCSS in the Browser by likortera on Friday June 10, 2022 @11:44AM (#31695738)
> It's basically the point of cascading style sheets

The "cascading" part is what makes it incredibly complicated. Keeping the "cascade" in sync with the actual markup is not a trivial task in teams with many people of different skills levels.

Not everyone is a top 1% dev, so we need easier and safer tools so that everyone can work and maintain a codebase.

> Sticking to proper class names and elements makes reskinning a breeze.

This is more easily said than done. It's like saying "Just don't write bugs". Every single project I find that has been built with BEM and similar patches after a couple years are just a mess and their CSS becomes "append only", as there's no guarantee that removing something won't break in unexpected ways.

Re:Play with TailwindCSS in the Browser by calvinmorrison on Friday June 10, 2022 @11:47AM (#31695776)
You're just shifting work though. The commit will now contain 10000 non html structure changes to an html, phtml, whatever, instead styles to a CSS sheet. Might as well go back to doing inline styles. There's a reason we don't do that anymore.
Re:Play with TailwindCSS in the Browser by yurishimo on Friday June 10, 2022 @12:54PM (#31696631)
This isn't the 90s. We all use file includes now. If you're working on a view file longer than a couple hundred lines, properly formatted, you're not abstracting enough or it's a one off marketing thing.
Re:Play with TailwindCSS in the Browser by lenkite on Saturday June 11, 2022 @04:53AM (#31702989)
"If you're working on a view file longer than a couple hundred lines,"

Sorry, but this might just mean one file-include per tag if you use tailwind-css. The in-line CSS exceeds the HTML content by sometimes an order of magnitude bloating the page HTML to ginormous size.

Re:Play with TailwindCSS in the Browser by calvinmorrison on Saturday June 11, 2022 @01:19AM (#31702147)
And there we go...

"We all use 'cascading sheets' now. If you're working on a CSS file longer than a couple hundred lines, properly formatted, you're not abstracting enough or it's a one off marketing thing."

Re:Play with TailwindCSS in the Browser by likortera on Sunday June 12, 2022 @02:57AM (#31712207)
> The commit will now contain 10000 non html structure changes to an html

It's an acceptable trade off. Nothing is perfect. In exchange you're guaranteed those changes only affect this markup, and not some other li > ul > a whatever somewhere else.

> Might as well go back to doing inline styles

No, it is not. This has been explained thousands of times anyone says "tailwind is like inline styles". You can do responsive, you're limited to a consistent subset of rules, minimal output css file, caching, etc, etc. For example, here [1] is an explanation why it is not the same, but there are thousands.

By reading your answers I deduce you've not used it yet. And this is exactly what is being discussed here. Fanatics closed inward looking people will never like it, nor anything that defies what they've been taught for years. Like religion almost. You have to try it for real to see the benefits. It is not perfect, but the net result is very positive for a lot of people as you can see from the usage statistics. Just be a bit more open minded to new tech and give it a try. At least you'll understand why it is not the same as inline styles which is a pretty basic thing you understand after 1 hour of using it.

[1] https://frontstuff.io/no-utility-classes-arent-the-same-as-i...

Re:Play with TailwindCSS in the Browser by kristiandupont on Friday June 10, 2022 @12:34PM (#31696375)
Crazy, in my entire career I've never been involved in a redesign that didn't involve the entire layout but only changed some colors, paddings and drop shadows.
Re:Play with TailwindCSS in the Browser by calvinmorrison on Friday June 10, 2022 @01:32PM (#31697094)
Definitely done it a bunch of times. Marketing comes out with some new web font crap they want and we need to go adjust everything. Flat face buttons become popular so we get rid of the pseudo 3d ones. They want to launch a new webstore but dont want to redesign, lets just steal one we have and reskin it a bit.
Re:Play with TailwindCSS in the Browser by gedy on Friday June 10, 2022 @11:15AM (#31695336)
> Not allowing developer to hand write CSS is a great restriction for a good bunch of developers.

I agree, main point is that I think there are better tools for large codebases. We had a "no CSS" rule where we used bootstrap components and utility classes only.