News for hackers. Stuff that matters.
Re:Tailwind V4 Is Finally Out by skeletal88 on Thursday January 23, 2025 @04:56AM (#42802491)
The problem is that with bootstrap I have card, table, etc. With tailwind I have an unreadable alpabet soup when I am not a designer but a developer and am not familiar with tailwind.
Re:Tailwind V4 Is Finally Out by Ralfp on Thursday January 23, 2025 @05:08AM (#42802543)
And then you build on that, and you have card-alert, card-message card-message-small, card-body-alert, card-body-message, card-form, card-login-form together with extra sass variables for them.

And then you ask "why not just have variable for each component, not each component's style?" and this is where tailwind steps in.

Re:Tailwind V4 Is Finally Out by gedy on Thursday January 23, 2025 @05:13AM (#42802572)
I greatly agree with you, but should mention that there is DaisyUI which is a Tailwind plugin that adds these for you. It seems inspired by Bootstrap and others: https://daisyui.com/
Re:Tailwind V4 Is Finally Out by mablopoule on Thursday January 23, 2025 @08:37AM (#42803848)
This is the big one for me. In any big enough or unfamiliar frontend project, my go-to way to explore the codebase is to launch the front-end, and use the inspector to check the elements, and then search-back in the codebase the relevant classes to see what page/component display that, and how does it fetches the data.

If there is only an alphabet soup, I no longer have a simple set of classes I can grep the codebase with to quickly find the relevant components.

Re:Tailwind V4 Is Finally Out by yurishimo on Friday January 24, 2025 @06:36AM (#42812188)
This is just not true. You can absolutely grep the soup (I do it daily). Most UI components share a lot of common baselines but include a specific modification for use in place (often a color or extra spacing). That means most of the time, the entire class string is unique to that element, even if the classes themselves are not. At most, you might have a couple of duplications, but then you should probably be looking at a template level component if the functionality is related.

`mx-4 py-2 rounded-xl shadow bg-green-500` is just as easy to global-search for as `notice--success`

Re:Tailwind V4 Is Finally Out by jitl on Friday January 24, 2025 @07:29AM (#42812474)
Use the component library’s inspector/devtools to identify components. Eg in a React app, look at the React component tree rather than the DOM tree