Live data from Hacker News

Play with TailwindCSS in the Browser

play.tailwindcss.com

41–50 of 300 posts

Re: Play with TailwindCSS in the Browser

#41

Earlier quoted context omitted.

"People who know these things think tailwind is a travesty" Sounds like people don't like changes to things that they are used to. Overall Tailwind really does make styling cleaner.

It makes your job easier at the expense of the quality of your product.

How does it affect quality?

Re: Play with TailwindCSS in the Browser

#42
I think part of the tailwind appeal is the top-notch integration into vscode. It made the learning experience even better for me. One of my favorite features are the large but limited color palettes in combination with states. I always found it messy to add another once-used button style to bootstrap, plus, then suddenly my button lives in multiple files.

Here‘s a nice green example button, written out of my head during my holidays: rounded p-2 border text-green-800 bg-green-100 hover:bg-green-200 active:bg-green-300 border-green-200 hover:border-green-300 active:border-green-400

It‘s long but somehow it‘s easy, readable, customizable and consistent. The limitations are still there though, just think of transitions and animations.

Personally, I would also be happy if inline styles wouldn‘t be with their limitations, but that entirely another topic.

Re: Play with TailwindCSS in the Browser

#45
post #16

Im sorry but I don’t understand how anyone can look at that and think it’s a good way to build UIs. I’m almost certainly in the wrong, considering how popular this library seems to be getting, but holy heck that looks like a tedious mess to work with. It’s like you have to learn every raw CSS selector, and then also learned how it’s represented in Tailwind, and then scatter that all over your markup.

Completely agree with you. I greatly prefer something like PicoCSS ( https://picocss.com/ ) which tries to use plain HTML5 as much as possible.

Interesting. I like the idea of clean HTML. It's probably great for small projects but I'm not sure it would scale for bigger applications.

Re: Play with TailwindCSS in the Browser

#46
post #9

Am I only one that feeling like code readability is a bit gross?

At least with a Tailwind attribute you know what you are getting.

A named CSS class can contain any definition and even if you are certain of those definitions, they can change depending on what the element is contained within.

Re: Play with TailwindCSS in the Browser

#47

For someone who usually avoids divs in favor of semantic tags, that many divs makes me uncomfortable ;-) I presume the use of so many divs is a stylistic choice and not a requirement?

Yes, you can add Tailwind rules to any element, use of Semantic elements is obviously preferred but not essential

Re: Play with TailwindCSS in the Browser

#48

Earlier quoted context omitted.

> It’s like you have to learn every raw CSS selector, and then also learned how it’s represented in Tailwind, and then scatter that all over your markup. In my experience, tailwind is pretty close to the real CSS properties. What I found to be wonderful and freeing about it is that it stops the middle step of engineering and naming classes and naming elements with class names and let's you just do styling. There's al…

CSS has special syntax for media queries, hover states, dark mode etc. If anything, once you are into it Tailwind is far more "guessable".

Correct, but wring all of those can get confusing and adding a single psudoselector syntax for something is at least a few lines and figuring out how to organize css. Scss is definitely better for this but even then it's a bit nebulous remembering which selector has the states in them.

Re: Play with TailwindCSS in the Browser

#49

Is there a VSCode plugin that help you do something like this: when I type text-20px it will try to find the closest class e.g. text-sm automatically?

Tailwind CSS IntelliSense will give you a list of all the possible classes with the associated pixel value.

You can also do text-[20px] if you really need that specific size.

Re: Play with TailwindCSS in the Browser

#50
post #16

Im sorry but I don’t understand how anyone can look at that and think it’s a good way to build UIs. I’m almost certainly in the wrong, considering how popular this library seems to be getting, but holy heck that looks like a tedious mess to work with. It’s like you have to learn every raw CSS selector, and then also learned how it’s represented in Tailwind, and then scatter that all over your markup.

Tailwind is a thin wrapper for the people scared of CSS. I use Tailwind at work, and it opened my mind to the benefits of an "ugly" html layout with inline styling. However, being there now, I think that inline CSS offers the better "Tailwind experience" - CSS requires no setup, and learning it properly is a good investment for the future when Tailwind, like so many other frameworks, will inevitably end up on the frontend dumpster fire.
Post reply on HN