HNHacker News
TopNewBestAskShowJobs

adamwathan

1,218 karma · joined December 6, 2014

submissionscomments
adamwathan··on TailwindCSS v2.0
Framework author here, yep it is a joke. We literally had the music scored for us by a friend with the goal of making it as outrageous as possible. There's a real opera singer chanting "utility first" in Latin at the end. It's a parody of itself :)
adamwathan··on TailwindCSS v2.0
Framework author here, yep the whole point of the trailer is to be absolutely ridiculous.

The music was custom scored for us by the best man at my wedding, and we had a professional opera singer record all of the chants at the end which are literally "utility first" in Latin.

It's completely outrageous and absurd :) It's the Old Spice commercial of launch videos.

adamwathan··on Tailwind CSS: From Side-Project Byproduct to Multi-Million Dollar Business
We've tossed it around, but ultimately we believe that our customers buy Tailwind UI because Steve and I designed/built it, and we've built a lot of trust in our community over the last 4-5 years. I wouldn't want to be a full-time QA person either.

Hoping instead that we can find the right small team size that lets us do more of this in a first-party way, and selectively support the tools we find people ask for the most.

Could definitely see a world where we work with experts in different technologies to port our stuff over and maintain it under some sort of retainer agreement though, just don't see us ever giving up any of the actual UI design or initial implementation work.

adamwathan··on Tailwind CSS: From Side-Project Byproduct to Multi-Million Dollar Business
No plans to go the VC route. We've hired three people now — two developers focused almost entirely on open-source, and another who splits his time between our commercial projects and contributing in our OSS community by answering questions, writing documentation and guides, etc.

We keep a few hundred grand in the bank as a payroll cushion but everything else gets pulled out and put in our personal bank accounts. We're both millionaires and financially independent at this point, and are only continuing to do what we do because we really enjoy it. We're building a small team so we have more freedom to pursue other fun R&D-style projects while still delivering on what our customers and community are asking for.

adamwathan··on Tailwind CSS: From Side-Project Byproduct to Multi-Million Dollar Business
This isn’t really what I was saying when I made that comment (in a personal conversation among a small group of friends).

I love that other people are building things on top of Tailwind and I think it’s great. I was only describing my own emotional state and how much pressure it makes me personally feel to finish our commercial projects, and how stressful it is to feel like there’s not enough time because my time has to be split instead of being able to just focus on the commercial tools.

Purely just me commenting on my own stress and being vulnerable among friends, not any sort of commentary on the ethics of other people building things on my OSS.

adamwathan··on Ask HN: Dear open source devs how do you sustain yourself
I created Tailwind CSS in 2017 and earlier this year we released Tailwind UI which is a commercial set of prebuilt HTML components to help support continued work on the OSS. It’s done about $1.5m in revenue since releasing at the end of February and now we’re hiring a few more people to help develop both the commercial product and a lot more OSS work.
adamwathan··on If I could bring one thing back to the internet it would be blogs
If I could bring one thing back it would be just plain old _websites_, when people would make a place on the internet dedicated to some topic that was organized in a way _other than_ chronological order, and just became a great resource where important information was always easy to surface.

Here's a great example that will probably trigger some nostalgia for anyone who grew up on the late 90s internet:

http://www.petesqbsite.com/

adamwathan··on Stripe raises $600M at nearly $36B valuation
Is this country-specific perhaps? I'm in Canada and it's no problem for me to withdraw USD to a Canadian-based USD account.
adamwathan··on CSS Zen Garden
Not true at all. You can build two sites that look completely different without changing the CSS at all if the API of the CSS framework is low level enough, like Tailwind, Tachyons, etc.
adamwathan··on CSS Zen Garden
> But can you do what CSS Zen Garden does only by changing HTML?

Yes of course you can, if you can change the HTML you can build an entirely different website, and you don't have to change the CSS at all because with something like Tailwind it's a "universal stylesheet".

adamwathan··on CSS Zen Garden
This approach is extremely seductive because on the surface it sounds so "pure" and "clean" but the reality is that on large projects it leads to some of the most horrific, hard to maintain CSS you'll ever see, no matter how hard you try to keep things in good shape. CSS is just inherently more difficult to maintain than HTML, and choosing a workflow that encourages editing CSS instead of HTML just makes things harder and harder over time.

Choosing an approach where CSS is treated like a third-party dependency that is _consumed_ by your HTML ends up being much more practical, maintainable, and scalable because editing and maintaining HTML is _easy_ — every time you change a class on an HTML element your changes are local and predictable.

Always thought this article by Nicolas Gallagher did the best job arguing this point:

http://nicolasgallagher.com/about-html-semantics-front-end-a...

adamwathan··on Webcam, Lights, and Audio for Remote Work, Podcasting, Videos, and Streaming
What you're hearing in that video is a space heater running in my office — I don't put a ton of effort into making everything perfect for ad hoc live streams.

A proper screencast is probably the better thing to judge:

https://www.youtube.com/watch?v=Ff_n_QClipQ

I'm sure you'll find something to nitpick over but I think it's pretty good for a programming tutorial recorded in my home office.

adamwathan··on Webcam, Lights, and Audio for Remote Work, Podcasting, Videos, and Streaming
A noise gate does not remove hiss or static, it simply reduces the volume of the signal when it gets below a certain level.

As a professional audio engineer in a past life, I can say the SM7B + Triton Fethead is a great recommendation. The SM7B has very good off-axis rejection characteristics and will pick up _much_ less room noise than most alternatives.

adamwathan··on Apple is trolling us on prices?
They are milled from solid blocks of aluminum, not created with a mould. In another thread another HN user pointed out that to buy a block of aluminum to mill something the size of the stand would cost $1400 from consumer facing suppliers.
adamwathan··on CSS Utility Classes and “Separation of Concerns” (2017)
Author here — a common question I’ve seen in the comments that I didn’t cover in the article is how you do responsive design with this approach.

Here’s a link to the responsive design guide in the Tailwind CSS docs that covers it in detail:

https://tailwindcss.com/docs/responsive-design

The TL;DR is you have breakpoint-specific versions of your utilities, so you can define all of your responsive behaviour directly in your markup.

For example this element would be `block` by default (on mobile) and `flex` when the browser is at or above some defined “medium” breakpoint:

<div class=“block md:flex”>

Two years after writing that article I can say CSS definitely feels “solved” to me, and every time I have to go back to an old Tailwind project it’s very easy to make changes.

If you’re building things with React, I’d also encourage you to explore projects like Emotion and Theme UI which allow you to work with the same philosophical approach (styling elements directly instead of through “hooks” and some separate style layer) but with a bunch of neat advantages that aren’t possible with a regular class/CSS-based API, like having better control over how style definitions override each other when applied to the same element.

Personally I’m still very happy using Tailwind even in React projects, because the syntax is more terse and it’s nice to have a singular styling paradigm that I can use even outside React projects.

adamwathan··on New Features in Vue 3
> I've never remotely wanted anything similar to this in Vue,

This was true of me as well until actually playing more with React. In practice, being able to very quickly extract a child component by just copying a chunk of code to a different spot in the same file is a very nice workflow benefit I now sorely miss when using Vue. In Vue my components tend to be larger and more complex than they are in React because I feel like some small extraction I want to make doesn't "deserve" it's own dedicated file, whereas in React I just quickly make a new function that returns some JSX and I'm done.

adamwathan··on Show HN: Tailwind.run – An Online Playground for Tailwind CSS
Scoped styles and SCSS do not prevent you from having to come up with unnecessary names for things like utilities do. That's the main benefit in my opinion. Wasting brain cycles to name arbitrary wrapper divs that only exist to be a target for layout styles things like ".image-card-content-wrapper" is a completely unnecessary step in the UI development process.

Using utility classes to build a UI is much more like building something with SwiftUI, where no one seems to argue about this silly "separation of concerns" thing we talk about on the web.

adamwathan··on Show HN: Tailwind.run – An Online Playground for Tailwind CSS
Creator of Tailwind here, that's exactly what I would recommend too.

Here are the markdown styles for my own personal website for example:

https://gist.github.com/adamwathan/d257699f16ec7cc1b002b5fb7...

adamwathan··on Typed Properties in PHP 7.4
You can invoke an anonymous function assigned to an instance property using `__invoke()`:

    class Foo {
        public $var;
    }
    $foo = new Foo();
    $foo->bar = function() { echo "Hello World\n"; };
    $foo->bar->__invoke();
Not pretty but that's how I've always done it.
adamwathan··on Write HTML Like It's 1999
Borders still affect the positioning of things even with box-sizing set to border-box. For example, here "Block 1" is still two pixels taller than "Block 2":

<div style="padding: 8px; border: 1px solid black"> Block 1 </div>

<div style="padding: 8px;"> Block 2 </div>

https://jsfiddle.net/t4rkvfzx/

adamwathan··on Slack abandons screen-control during sharing, recommends Zoom
As someone who had no need for Slack but did need to do a lot of remote pairing, I was really bummed when they acquired ScreenHero and was forced to find another tool.

I’ve been using Tuple since the first alpha was released and it has been awesome. They don’t have multiple simultaneous cursors (yet) but I actually like their current system more, only one person can control mouse/keyboard at a time and you just click to take over. Feels more like face-to-face pairing where only one person is driving at a time. As a bonus the mouse control actually feels right because they don’t have to do any weird hacks to trick the OS into displaying two fake cursors, it respects your tracking speed settings and all that stuff properly.

Performance is great too, I’ve been pairing 20 hours a week with a friend on a slower connection who lives in Arkansas (I’m near Toronto) and even sending 5K back and forth has worked flawlessly for hours at a time.

Really, really good product.

adamwathan··on GitHub Sponsors
Yep 100% agree, this is how both Vue.js and Laravel have succeeded with "donations" on Patreon which are actually companies paying for advertising space on the project's respective websites. Both are doing 6 figures annually in recurring "donations", which is almost entirely from $xxxx/mo tiers targeted at businesses.

I think the other thing that is better about doing things this way is that when a company is buying ad-space from you, it's very clear what they are paying for. With the current peer-to-peer setup that was shipped this week, I guarantee the "please fix my issue I donate $10/month!" problem is much more likely than it is with a company who is paying to have their logo on your website.

adamwathan··on Apple resumes selling iPhone SE at lower $249 price on its clearance store
Hmm don't think I buy this, at least in Apple's case.

They have a monopoly on the operating system, which is what people really want with both the iPhone and the Mac.

People will still spend $3000 on a 15" MacBook Pro that they hate (because of the ridiculous touchbar) because it's the only high spec'd laptop available with macOS.

There's no way for consumers to tell Apple "we prefer no touchbar" purely with sales data because they aren't given the choice.

I think that same factor is huge with the iPhone. I have bought multiple 4.7" iPhones now, all of which I hate because of the size, but it is the smallest (correction: smallest premium) phone Apple makes/made. So looking at the data, it looks like I love the new iPhone size because I bought it, but the reality is I had no choice if I wanted to keep using iOS and didn't want to deal with a horrible experience performance-wise from aging hardware.

adamwathan··on Ask HN: What's the best book on modern UI/UX?
Author of that book here, I swear to god had nothing to do with this thread, just stumbled upon it myself perusing HN. Wish I could prove it somehow :(
adamwathan··on Tailwind: style your site without writing any CSS
These are the CSSStats.com stats for the companies you mentioned:

Airbnb (332kb, 54 text colors, 72 background colors, 48 font sizes): https://cssstats.com/stats?url=http%3A%2F%2Fairbnb.com&ua=Br...

Walmart (178kb, 32 text colors, 22 background colors, 64 font sizes): https://cssstats.com/stats?url=http%3A%2F%2Fwalmart.com&ua=B...

Twitter (630kb, 36 text colors, 50 background colors, 46 font sizes): https://cssstats.com/stats?url=http%3A%2F%2Ftwitter.com&name...

GitHub (658kb, 157 text colors, 141 background colors, 55 font sizes): https://cssstats.com/stats?url=http%3A%2F%2Fgithub.com&name=...

These are not stylesheets I want to emulate. As I mentioned in my other reply, GitHub is actively moving towards a more utility-based approach to solve this problem.

Compare this to a fairly large app where the CSS and markup were completely rewritten using Tailwind by a friend of mine recently:

https://cssstats.com/stats?link=https%3A%2F%2Fapp.churchsoci...

41kb (8.1kb gzipped), 15 text colors, 44 background colors, 22 font sizes. Pretty good, no?

adamwathan··on Tailwind: style your site without writing any CSS
Tailwind would come out ahead because there are fewer classes that contain the same declarations, so the total number of style declarations would be less.
adamwathan··on Tailwind: style your site without writing any CSS
(Author of Tailwind here)

The difference is that inline styles can't use several important CSS features, like media queries or pseudo-classes like `:hover`, `:focus`, etc.

You have to first be convinced that inline styles are not inherently an anti-pattern to understand a framework like Tailwind. After that, the benefit of Tailwind is that it's like inline styles, except with the ability to style elements in different states and at different screen sizes.

I wrote a post a while back that is my best effort at arguing for the validity of presentational class names if you're interested: https://adamwathan.me/css-utility-classes-and-separation-of-...

adamwathan··on Tailwind: style your site without writing any CSS
GitHub has been switching to functional CSS over the last couple of years: https://primer.style/

I interviewed Diana Mounter who leads their design systems team about this a while back: http://www.fullstackradio.com/75

adamwathan··on Tailwind: A Utility-First CSS Framework
This is a totally real problem and one of the things that put me off of using some of the existing utility frameworks before creating Tailwind.

With Tailwind, we don't try to pretend that you will never need to write any CSS, and instead embrace that fact and give you as much tooling and guidance as possible on how to extend the framework the way it was intended to be extended.

In the situation you're talking about, you would extract a "component class" using Tailwind's `@apply` directive to enforce that the component followed your design system:

https://tailwindcss.com/docs/extracting-components

Then you could update all your buttons at once by making changes to that component class.

The key with Tailwind is that it encourages a "utility-FIRST" workflow, not a "utility-ONLY" workflow. Build your UI with small primitive utility classes, and extract components only when you start to experience painful duplication problems.

adamwathan··on Tailwind: A Utility-First CSS Framework
Author of Tailwind here! If you haven't worked with a library like this before, I promise your gut reaction will be "holy hell this is the worst thing I've ever seen" (it was my reaction too!)

You really do have to try it to shake that impression.

If you need a bit more convincing before you're willing to try it, I wrote an in-depth article a while ago that documents my journey from a "semantic classes"-loving HTML/CSS purist to a utility-loving heathen:

https://adamwathan.me/css-utility-classes-and-separation-of-...

If you want to watch it in action, here's a screencast where I rebuild the Netlify UI in an hour and a half without writing any custom CSS:

https://www.youtube.com/watch?v=_JhTaENzfZQ

...and if you want "social proof", here's an interview I did with Diana Mounter who leads the design systems team at GitHub about how moving to a utility-based approach has made things infinitely more maintainable for them, and given their developers a lot more confidence:

http://www.fullstackradio.com/75

If you have any questions I'll be checking the comments, thanks!

← PreviousPage 2 of 3Next →