Hacker News new | ask | show | jobs
by BoorishBears 1694 days ago
I'll just throw out there that I'm someone who's been developing for a long time but never been able to get into web dev.

It just always feels clunky for me, there's way too many divergent approaches, best practices are constantly moving.

-

I'm designing a web frontend for an embedded project I'm working on and decided on Mithril + Typescript + Tailwind CSS and DaisyUI.

And it's the first time I've felt productive with web tooling.

Tailwind/Daisy UI makes so much more sense than any other styling approach I've ever tried.

I mean, is there a reason I wouldn't want to say an element is a "large red button" rather than a "setup-wizard-login-button" and defining that somewhere else?

Maybe I'm missing something that becomes a problem at a larger scale but for me this utility based approach is great.

1 comments

Interesting. I've had a theory that Tailwind appeals to full-stack developers more than dedicated web front end developers. If you have to jump from context to context a lot, adding one new context (separate CSS), is an actual burden. All the extra abstraction can seem like a waste of time.

> I mean, is there a reason I wouldn't want to say an element is a "large red button" rather than a "setup-wizard-login-button" and defining that somewhere else

I wouldn't create a `setup-wizard-login-button` class. That's getting too granular. In the apps I've worked on there's usually been a `<Button>` component that encapsulates a lot more functionality than just being large and red. It deals with stuff like accessibility, custom disabled states, transitions, etc. It makes sense to encapsulate all of that into one component, then use something like `<Button type='primary'/>` everywhere. In this example, `primary` would map to a design token for a particular style that would handle all the permutations of how that style affects other states, transitions, etc. If you're just applying `large red button`, you're not getting any of that stuff, and I don't see a good reuse pattern for it. So I suppose it depends on how complicated your design system requirements are.