Live data from Hacker News

Moving away from Tailwind, and learning to structure my CSS

jvns.ca

401–410 of 435 posts

Re: Moving away from Tailwind, and learning to structure my CSS

#401

Earlier quoted context omitted.

WAI's APG patterns exist to document how ARIA attributes should work, they don't advocate for them to be used in place HTML elements. They also don't test to confirm that they actually work in browsers or with assistive technologies (some specific patterns are fine). For web developers, they're helpful for documenting expected keyboard interaction support and other norms. Are you still coding to support Internet Expl…

Details/summary had quirky/inconsistent handling by screen readers for quite a while after it reached full browser adoption, unfortunately. Not even sure if they’ve fixed it here in 2026, honestly. https://www.scottohara.me/blog/2022/09/12/details-summary.ht... While it’s good to use well-implemented semantic elements when possible, there are still plenty of places where either the built-in browser behavior isn’t act…

I think popover and invoker commands with polyfills are already the way to go. The polyfills are small (and if you only want to use the "show-modal" invoker, it's like 10 lines to feature detect and polyfills just that).

Many good uses of popover really needs anchor positioning. There's a polyfill for that as well but it's not small.

Re: Moving away from Tailwind, and learning to structure my CSS

#402

Earlier quoted context omitted.

> tailwind frees you from having to spend excessive time building abstractions of styles/classes that will invariably change. Abstractions like a hero image, a menu, a headline? Sure, it's easy to overthink things but most of the time, it's not that complex. > placing the styles directly into the markup that is affected by it reduces cognitive load, prevents excessively loose selectors In my opinion, it's the opposit…

Trashing without offering a hands down solution is academic and therefore can safely be rejected. Please show me only ten of the SaaS you lead that rely on your CSS framework. You must have one, because you talk about structure and premises. Orderly put and repeatedly applied you get a framework. I doubt it. I registered my first domain 1997. I love to debate anyone coming up with a clever not so clever theoretical a…

> love to debate anyone coming up with a clever not so clever theoretical argument against Tailwind.

Given your attitude (see your last sentence for a prime example), why would anyone want to debate you?

Re: Moving away from Tailwind, and learning to structure my CSS

#403

Earlier quoted context omitted.

> tailwind frees you from having to spend excessive time building abstractions of styles/classes that will invariably change. Abstractions like a hero image, a menu, a headline? Sure, it's easy to overthink things but most of the time, it's not that complex. > placing the styles directly into the markup that is affected by it reduces cognitive load, prevents excessively loose selectors In my opinion, it's the opposit…

With CSS names are global. You have to be careful not to accidentally create a class that conflicts with another one used elsewhere in a different context. You have to worry about whether modifying your class will have downstream effects on elements you weren’t intending to impact. It’s a giant pain. I’ve done it by hand for around 20 years before switching to Tailwind. Can vanilla CSS be used for a complex app? Yes.…

Unless you're duct taping together a wide variety of kitchen sink dependencies, namespace shouldn't be a problem.

Re: Moving away from Tailwind, and learning to structure my CSS

#404
post #186

Earlier quoted context omitted.

I disagree with that conclusion. I see tailwind as a cleaner more succinct version of css that is much easier to manage and add features too. Sure it’s not as dry, but I’ve been bitten in this regard because css framework and templates are so intransparent, preventing me from simply changing padding or margin. CSS is too detailed and too verbose. Frameworks like bootstrap are too high level and don’t give enough cont…

> Sure it’s not as dry, but I’ve been bitten in this regard because css framework and templates are so intransparent, preventing me from simply changing padding or margin. How does this happen? You can always override css values. Either by ordering, !important, inline or, to make very sure, with inline !important.

I found that once I started needing to use inline styles or !important or in-line important, I was in for a world of hurt and felt sorry for whoever maintained the project after me.

Re: Moving away from Tailwind, and learning to structure my CSS

#405
post #34

For me Svelte and LLM completely removed my need for Tailwind. Turns out I was using it primarily to avoid CSS collision, and (to me) more logical syntax, rather than the self-imposed constraints.

Why did Svelte affect your stance towards Tailwind?

Svelte namespaces styles to the component and also has some lint checks for unused selectors.

Re: Moving away from Tailwind, and learning to structure my CSS

#406

Earlier quoted context omitted.

If a tool’s design makes it easy to cut myself, the response is not “people have been cutting themselves for years”. There is such a thing as the ergonomics of the tool. Yes div soup has been around a long time. But also yes, Tailwind makes the wrong approach the easy one. It’s ergonomics encourage adding div elements to support styles. It’s the core design loop. You’re conflating “forces to” and “ergonomically encou…

It’s just the most effective approach, in my opinion. If it’s wrong then I don’t want to be right.

to solumunus: notice your comment downvoted? it appears someone who is against Tailwind downvotes all pro-Tailwind comments. I think i know who- and will reciprocate in kind.

Re: Moving away from Tailwind, and learning to structure my CSS

#407

One thing that has always struck me about Tailwind is that practically every argument its proponents use more or less boils down to “I never learnt CSS beyond a junior level” . It’s super common to hear Tailwind advocates say things like “Without Tailwind, we would just have one big disorganised CSS file that always grows uncontrollably and ends up with loads of obsolete stuff in it and !important everywhere! Tailwin…

Do you have an actual list of arguments with the steps you take to boil them down to ignorance? CSS is a design system, as like any system it can be poorly designed. Poorly designed systems require more effort to operate, and you can even call that "skills", but that just ignores the core issue of comparing design of those systems

Re: Moving away from Tailwind, and learning to structure my CSS

#408
post #8

Earlier quoted context omitted.

While I agree I do think there's some "aspiration of purity/correctness" in your approach that I've long let go of. I look at the royal mess that is HTML/CSS/JS as a necessary evil, required when we want to target browsers. To me it's "just the presentation layer". In my work I put a lot more emphasis on correctness in the db schema, or business logic in the backend. When it comes to the messy presentation layer I pr…

You don’t think it’s valuable taking time to improve the interaction layer that all your users interact with your app through?

Have you seen the frontend of most apps? =]

The conversations here regarding UX? (Acting like it’s black magic, not basic empathy?)

The exact same disconnection exists between dev and abled users.

Re: Moving away from Tailwind, and learning to structure my CSS

#409
post #398

Earlier quoted context omitted.

If you're using components, it's the same as Tailwind, just put your CSS module files next to the component, or use compile time CSS in TS frameworks like PandaCSS to have them in the code itself. For shared conventions that is the purview of the design system and you'd have CSS tokens for various colors etc. Anything you can do in Tailwind you can of course do in CSS modules because it's CSS at the end of the day.

That isn't just CSS modules, then, but additional tooling on top.

Eh, no, it's using CSS as designed. Variables are in CSS for example. It is not additional tooling at all.

Re: Moving away from Tailwind, and learning to structure my CSS

#410

> I got curious about what writing more semantic HTML would feel like. I've been teaching semantic HTML / accessible markup for a long time, and have worked extensively on sites and apps designed for screen readers. The biggest problem with Tailwind is that it inverts the order that you should be thinking about HTML and CSS. HTML is marking up the meaning of the document. You should start there. Then style with CSS.…

Yeah, while you certainly can write semantic HTML with Tailwind, it absolutely doesn't encourage it. It's funny how Tailwind is conceptually going back to inline styles.

But sure, if you have , and components etc. instead of using HTML elements , , etc. directly, then why not stuff the CSS into the components as well? It all depends on whether you prefer to use components, HTML elements or a combination as your favourite abstraction.[0]

[0]: https://mastrojs.github.io/blog/2025-11-27-why-not-just-use-...

Post reply on HN