Live data from Hacker News

Vanilla JavaScript support for Tailwind Plus

tailwindcss.com

81–90 of 202 posts

Re: Vanilla JavaScript support for Tailwind Plus

#81

Lovely. Verbosity aside, now on top of knowing CSS you need to learn another hierarchical system within class names.

Groups are great. It lets a child element activate an effect on a parent element.

    Hover
This eliminates the need for JS for a wide range of things.

Re: Vanilla JavaScript support for Tailwind Plus

#82
post #24
post #21

Looks like it's done using standards-based web components[0]. The page says these components don't require any existing JavaScript framework; because web component support is built-in to the browser. Nice to see devs picking up web components. [0]: https://developer.mozilla.org/en-US/docs/Web/API/Web_compone...

This has been soooooooo long in the making, i remember playing with webcomponents for personal stuff years ago when i didn't care about compat. Good to see mainstream libraries finally picking it up

https://webawesome.com is now in beta and I couldn't be happier.

Re: Vanilla JavaScript support for Tailwind Plus

#83
post #10

Tailwind is fine, but I do find it humorous that they discourage wrapping up tw classes into a component class ala Bootstrap, but they wrap html up like this: Options ... Bootstrap: Dropdown button ... (I realize you have full control over looks with TW, but Bootstrap and others have utility classes too for the common stuff.)

The wordiness is a common complaint but TBH it's a minor issue, I do have a growing problem with using tailwind that's hidden just behind that superficial complaint though.

px-3, py-2, bg-red-400 etc. are everywhere in tailwind code and they become more or less undocumented conventions. Technically you can configure them, but practically without unintended side effects on an existing project? And if you make extensive config changes, have you just locked yourself out of the ecosystem?

I don't use bootstrap, but from a brief look at the documentation it seems much more reasonable to diverge from defaults. Looking at themes (https://themes.getbootstrap.com/) it seems more flexible than an average tailwind setup.

Re: Vanilla JavaScript support for Tailwind Plus

#84

Lovely. Verbosity aside, now on top of knowing CSS you need to learn another hierarchical system within class names.

In real projects I typically group the classes in a way that makes it easier to read, something like this:

    
        ...
    
I currently do this manually but it would be nice to have some tooling to automate that kind of format.

Re: Vanilla JavaScript support for Tailwind Plus

#85

Lovely. Verbosity aside, now on top of knowing CSS you need to learn another hierarchical system within class names.

Groups are great. It lets a child element activate an effect on a parent element. Hover This eliminates the need for JS for a wide range of things.

But at what cost? If it’s not a CSS builtin, it’s going to use JS - it may not be something you care about, but it will be there. There’s no other way.

Re: Vanilla JavaScript support for Tailwind Plus

#86
post #21

Looks like it's done using standards-based web components[0]. The page says these components don't require any existing JavaScript framework; because web component support is built-in to the browser. Nice to see devs picking up web components. [0]: https://developer.mozilla.org/en-US/docs/Web/API/Web_compone...

12 years I’ve been saying this… 12, damn, years. React graduates look at me crazy. Angular devs say it’s not needed anyway. Svelte bros say get bent. I’m so happy that someone is paying attention.

You don’t need a shadow dom, you don’t need rerendering of everything when a simple value changes. You simply need web components and scoped js/ts with vite or whatever rollup you use.

Re: Vanilla JavaScript support for Tailwind Plus

#87
post #60
post #35

Earlier quoted context omitted.

Worried about money? They are already rich beyond their wildest dreams. They are, reasonably, excited about growing and expanding and building a company that does much more, but that is not driven by a need for money, it is driven by their ambition. edit: I can’t speak for Adam etc., this is just my impression. My impression is that they want to build a business of which tailwind (the open source project) is one part…

interesting, i had just watched Primeagens Standup with Adam and got the impression they don't do well for money, but a quick google came up with a bunch of posts from Adam himself disclosing some fairly impressive numbers. No idea if he still does ok from it, but he certainly did at one stage.

We are still healthy and profitable but revenue is down about 60% from peak, and continuing to trend down (I think mostly due to AI and open-source alternatives to the things we've historically charged for.)

So things are fine but we do need to reverse the trend which is why we are pretty focused on the commercial side of things right now.

We started a corporate sponsors/partner program recently, and I'm hoping that will earn us enough funding to focus more on the free/open-source stuff, since that's where we create the most value for the world anyways. Fingers crossed!

Re: Vanilla JavaScript support for Tailwind Plus

#88

This is a exciting use-case for custom elements, and probably how tailwind should have been implemented from the start, but it’s hilariously a paid feature?! ( https://tailwindcss.com/plus#pricing ) Intuitively, I’d expect the custom elements to be free and the framework integrations to cost money.

Thanks! It's a paid feature because we just spent around $250,000 developing the library. Couldn't have built it if we were just going to give it away and maintain it forever for free, our engineers are talented people and deservingly well-paid.

Re: Vanilla JavaScript support for Tailwind Plus

#89

Earlier quoted context omitted.

Groups are great. It lets a child element activate an effect on a parent element. Hover This eliminates the need for JS for a wide range of things.

But at what cost? If it’s not a CSS builtin, it’s going to use JS - it may not be something you care about, but it will be there. There’s no other way.

I believe it's regular old css. The :has() pseudo class.

https://developer.mozilla.org/en-US/docs/Web/CSS/:has

Re: Vanilla JavaScript support for Tailwind Plus

#90

Earlier quoted context omitted.

Why not use the web inspector? That’s usually the quickest way to see which style is applied to an element.

People would rather have to parse out a big dumb list of classes than look at the actual list of what properties affect something, with a clear ability to drill down into them. Its madness, akin to carpenters giving up hammers, preferring to use glue, because they hit their thumb a few times by accident

Based on the code I've seen, including written by old me, it seems more like designing the architecture of the CSS styles (and sticking to it) is something people don't like to do. Tailwind is just a tool that is nicer than using the style attribute on the element.

I strongly prefer "button is-primary is-fullwidth" over the long list of tailwind classes.

Post reply on HN