Live data from Hacker News

TailwindCSS v2.0

blog.tailwindcss.com

401–410 of 474 posts

Re: TailwindCSS v2.0

#401

Framework author here! Don't miss the new landing page, it is probably the part I was most excited to share :) https://tailwindcss.com/ Crazy amount of effort went into building all of these interactive examples, so proud of how it turned out. The trailer in the blog post is absolutely 100% a joke in case it's not obvious. The music was scored for us by a friend, and that's a real life professional opera singer at th…

It's very obvious (in many different places: landing, documentation, streams) that TailwindCSS is made with love. Thank you for that!

P.S. Trailer is cool!

Re: TailwindCSS v2.0

#402

Earlier quoted context omitted.

I am definitely missing something. What I don't get: if tailwind provides all the preprocessor parts, why do people need to put the class definitions as part of the HTML? I would completely get behind tailwind if it was only the SASS part. Give me a bunch of mixins and consistent variable naming, which I could just `@import` into a sass file where I get the definitions for UI elements, widgets, etc... the whole "Desi…

HTML and CSS are inseparable. Or at least, CSS can't do anything without the proper references in HTML anyway. And you're likely using IDs and classes already to target, so instead of typing the name in HTML and the styles in a stylesheet, why not just condense into typing the style as a class name in the HTML? This carries you pretty far while you can still customize as necessary. I do skip tailwinds when I'm not wo…

> why not just condense into typing the style as a class name in the HTML?

Because the style may change, but the underlying data won't. I know that nowadays everyone default architecture is to have data coming from some json API and that will have to be processed and rendered in the client anyway - but it is not just because something is the common case that it is the only case.

By looking at the discussions, I am starting to realize that most of the people that are okay with mixing HTML and CSS have only to work with one application to be worried about. If that is the case, then yes, it gets obvious why people want to treat everything as object code.

Consider different scenarios, though. Think of how many APIs could've been avoided if we actually looked and said "HTML is data content and structure, and CSS is presentation, so why can't the HTML be the API? The microformats people have been clamoring for this for decades already, yet no one listens. How much fragmentation could be reduced if we had half-dozen frontend developers saying "we are going to build a JS component library that is strictly about behavior so that anyone can style however they want with CSS"? All of those man-hours wasted reinventing wheels just because there is an unnecessary coupling between component structure and styling, penny wise and pound foolish.

It's almost as if companies don't want to have their data easily accessible outside of their own sites and if developers actually want to spend their time reconfiguring databases and creating ever-growing Rube Goldberg machines for their own fun and profit...

Re: TailwindCSS v2.0

#403

Earlier quoted context omitted.

That's the tail wagging the dog though… I've got clients whose customers using IE11 represent 1-2% of revenue i.e. $1M+ / year

How much could they increase the revenue from the 98-99% by if they dropped IE11 and moved faster, spent less time on supporting old browsers, or embraced new features? It's possible (even likely) that simplifying the code by supporting fewer targets that need additional work would increase the overall profit.

Most likely zero

They're an online retailer and those customers would just go to someone else who's site would work in IE11

People aren't stuck on IE11 out of choice, it's corporate policies and other factors at play

Re: TailwindCSS v2.0

#404
post #357

Tailwind is the most counterintuitive yet obvious-in-hindsight CSS tool (or of any class - no pun intended) I've worked with. I know the general sentiment towards Tailwind is "I spent years getting my separation of concerns with HTML/CSS down, but now you're telling me all that is backwards and CSS Zen Garden is blasphemy?" I was in the same boat. Tailwind just felt wrong, and with 15+ years of experience, I've come…

It's wrong because it's useless: you can use inline styles instead (and if you gzip the html it's probably going to be smaller as long as you factor in the framework, since essentially you are using numeric LZ backreferences instead of useless long class names). The whole point of CSS classes is that they don't map to fixed styles, so they offer a useful abstraction, allowing you to change the CSS class definition on…

I'm not using Tailwind, but that comparison is wrong. Something like mt-2 still doesn't map to a fixed style, and it also has another specificity than inline styles which makes it easier to override.

If you need to globally change the margin that mt-2 adds, you only need to change that class instead of all HTML inline styles.

Re: TailwindCSS v2.0

#405
post #160

Earlier quoted context omitted.

That's the tail wagging the dog though… I've got clients whose customers using IE11 represent 1-2% of revenue i.e. $1M+ / year

yes but one of my central arguments [1] is that it is time to explicitly charge customers for IE11 support rather than implicitly have your 99% of customers subsidise support for the 1% 1: https://www.swyx.io/ie11-eol/

Yes, but you're using that argument in the context of a software business rather than a consumer facing retail business

Re: TailwindCSS v2.0

#406
These look like great improvements! I've been using Tailwind one a medium-large solo project and I can confidently say the whole project is MUCH better designed than it would have been without Tailwind, while still looking very custom.

Tailwind is not the one true way to do CSS, but it saves me from myself. I think of Tailwind vs Regular CSS how I think about TypeScript vs Regular JS. I could do everything and more in JS, but I'd make so many more mistakes along the way.

Re: TailwindCSS v2.0

#407

Earlier quoted context omitted.

I think you might be looking at tailwind the wrong way here. Tailwind does “enforce” separation of concern between styling and content, just in a different way than the separation of html and css. Consider the utility class m-1 and m-2. What they are supposed to say is that element with m-1 class and element with m-2 class should have different margin, with the m-2 element probably have a slightly bigger one, and eve…

If you tell me that there is a way to make all the utility classes completely private and available only for composing styles that can then be @apply'd to your CSS code, I'd not only agree with you but I would preach it as the One True Framework and Adam would be my Pope. But if you are saying that you have different "utility" classes to specify different margins, and if these classes end up in your HTML, you already…

I no longer think of myself as a "document writer", and there honestly would not be room in my team for someone who only wanted to touch the HTML and not the CSS or vice versa.

I was there for the Zen Garden, and it was great at the time and in its context (Flash and image maps!), but now I'm using the web stack for a 3D editing application, and my last job was complex GUI for managing large number of IoT devices. The idea of separating "the content" from "the presentation" does not apply anymore. It's just not a thing. Good software engineering is super important, more-so than ever I'd say, but keeping some parts of the UI in the .css files and some of it in the .ts files does not equal adequate "separation of concerns" in my context. It's just not that simple anymore, and in fact in the previous job it was an impediment, since UI refactors became much harder because of the state of the .css files. In my new project, which was moved over from Bootstrap shortly after I started, Tailwind has made sure that many of the old problems just don't arise anymore.

Re: TailwindCSS v2.0

#409

Tailwind smells like using a style attribute but with properties that are fewer characters. It's fully embracing what everyone said to avoid. What am I missing?

The stockholm-syndrome of the few users positively recommending something that changes their development workflow slightly when they were bored of doing things the old ways.

Ah yes, few users. Which is why this post was on top of HN frontpage.

And yes, definitely it's just that it changed the development workflow slightly, not at all that it brings new possibilities and a much better developer experience.

Re: TailwindCSS v2.0

#410
Can't wait to upgrade to v2.0. I've used Tailwind CSS/UI very extensively over the last year or more. The time I've saved in my day to day client dev work is incredible. Some of my notable recent projects using the framework include:

https://www.hawking.org.uk (Adam Wathan often uses it as an example of how different sites built in Tailwind can look - https://twitter.com/adamwathan/status/1298932488769875968)

https://www.paced.email (While a bit more Tailwind-esque, the framework has allowed me to concentrate on functionality while knowing the product will look great in the end).

Happy the TailwindLabs team is getting the exposure they deserve. Congratulations folks. Thank you for the awesome tools!

Post reply on HN