Live data from Hacker News

Play with TailwindCSS in the Browser

play.tailwindcss.com

241–250 of 300 posts

Re: Play with TailwindCSS in the Browser

#241
post #99

There is only two kinds of people. The ones that don't like Tailwind and the ones that have used it. I know it is conceptually "wrong" and a bunch of well crafted CSS classes would be more elegant. In the end it works, works really well and makes collaboration dead simple. Commonly used groups of classes can either be aliased by @apply or used in a (react) component. I used CSS way before Tailwind was a thing and in…

No at the end you end up having to learn all their classes, for almost no gain in speed of dev, and then you forget how to do stuff in CSS. For me Tailwind barely make it anything faster but I have to learn all their classes and then I am stuck to have to relearn CSS when their is custom stuff. Maybe for greenfield or MVP sure. But if you are on a big project you have one or more designers and 99% of the time you hav…

> then you forget how to do stuff in CSS

This is completely nonsensical because Tailwind classes are almost all just shorthand aliases for single CSS properties. You cannot use Tailwind without understanding CSS; it is CSS.

Re: Play with TailwindCSS in the Browser

#242
post #67

Earlier quoted context omitted.

The problem is you're looking at a single input box. Typically those would be defined as an object and have a prop passed in to configure colors and such. You're typically using it with a frontend framework or web components. If you're in Rails you can use ViewComponents or use apply syntax for primitives. Primitives are the outlier. You define them once and they're out of the way. Where it shines is when you're not…

If you are doing components in react instead of using classes how does this solve the problem of coming up with class names? You still have to come up with the class name you just apply it to your react component instead of in css.

Because you only have to name , not .my-input__label, .my-input__tooltip, .my-input__validation-error etc etc

Re: Play with TailwindCSS in the Browser

#243
post #214

People here are complaining about how Tailwind is annoying because the className strings are too long. The correct solution is to write a quick 1-file helper. See: https://gist.github.com/vedantroy/80fb2feb21b07b6f53032b8725... I wrote that. It allows me to do stuff like: const Button = tw.div(` bg-blue-500 rounded `) Any complaint about how tailwind forces overly long class names should probably look at this comment…

I’m not sure if JSX supports it but Vue templates and of course just regular old HTML allows a class to span multiple lines anyway. It doesn’t all have to be on one huge line.

Re: Play with TailwindCSS in the Browser

#244

There is only two kinds of people. The ones that don't like Tailwind and the ones that have used it. I know it is conceptually "wrong" and a bunch of well crafted CSS classes would be more elegant. In the end it works, works really well and makes collaboration dead simple. Commonly used groups of classes can either be aliased by @apply or used in a (react) component. I used CSS way before Tailwind was a thing and in…

> There is only two kinds of people. The ones that don't like Tailwind and the ones that have used it.

I exclusively write server-side templates with minimal to no javascript. I don't like Tailwind because it doesn't work for that.

Re: Play with TailwindCSS in the Browser

#245

Earlier quoted context omitted.

The killer for SASS nowadays is CI. You're either using the (ancient, slow) Ruby implementation of SASS, or node-sass which requires a native binary build and causes headaches across environments. Furthermore, with Post-CSS, the feature set of SASS has been completely subsumed by the latest CSS standard. There's really no good reason to use it anymore.

It's Sass, not SASS. The native libsass is much faster. The headaches come from people trying to distribute binaries and libraries through NPM.

If we're being pedantic technically it's npm and not NPM ;)

Re: Play with TailwindCSS in the Browser

#246

There is only two kinds of people. The ones that don't like Tailwind and the ones that have used it. I know it is conceptually "wrong" and a bunch of well crafted CSS classes would be more elegant. In the end it works, works really well and makes collaboration dead simple. Commonly used groups of classes can either be aliased by @apply or used in a (react) component. I used CSS way before Tailwind was a thing and in…

> There is only two kinds of people. The ones that don't like Tailwind and the ones that have used it. I exclusively write server-side templates with minimal to no javascript. I don't like Tailwind because it doesn't work for that.

Why does it not work for server-side templates?

Re: Play with TailwindCSS in the Browser

#247

Earlier quoted context omitted.

> There is only two kinds of people. The ones that don't like Tailwind and the ones that have used it. I exclusively write server-side templates with minimal to no javascript. I don't like Tailwind because it doesn't work for that.

Why does it not work for server-side templates?

If anything it feels like Tailwind would work great specifically for this use case

Re: Play with TailwindCSS in the Browser

#248
post #80

I used to be a Tailwind hater. I couldn't fathom why anyone would ever use it. And then I used it. It seriously makes CSS significantly easier to maintain, dramatically reduces your CSS build size, and is really good for teams if you're trying to use consistent CSS throughout your UIs. You also don't need to go back and forth between CSS file and HTML file. If you're on the fence, try it out. I think it's the future…

I completely disagree. To fix the css + jsx in one file, just write your styled components at the bottom of your component. If you ever seen a react component completely riddled with Tailwind, you'll realize how messy and uncoordinated it looks. Even I would consider switching between two files just to avoid that style of css. Furthermore the necessity to utilize horizontal scroll because adding 10+ more rules will i…

I wrote a “function” for this exact reason. It’ll display the classes in a much easier to read way. It also can type check to ensure that all classes are valid. I say function in quotes because it’s actually a babel macro that’s get compiled down so there’s no runtime cost! https://github.com/fleck/class-types.macro#better-prettier-f...

Re: Play with TailwindCSS in the Browser

#249
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.

[deleted]

Re: Play with TailwindCSS in the Browser

#250
post #80

I used to be a Tailwind hater. I couldn't fathom why anyone would ever use it. And then I used it. It seriously makes CSS significantly easier to maintain, dramatically reduces your CSS build size, and is really good for teams if you're trying to use consistent CSS throughout your UIs. You also don't need to go back and forth between CSS file and HTML file. If you're on the fence, try it out. I think it's the future…

> it's the future of writing CSS. Tailwind didn't invent utility classes. We've done this since the '90s. > significantly easier to maintain Disagree totally. Utility classes are good for rapid prototyping. But they clutter your code, mix semantics with presentation, and are a pain in the ass when it comes to code reuse. The cascade part of CSS is, believe it or not, actually useful for code reuse. Need to change a f…

[deleted]
Post reply on HN