Remix.run Logo
freedomben 4 hours ago

You're not wrong, and I mostly agree with you. I die inside when I see the div soup that a lot of sites have become. However, I think there is value in being able to have the important parts of CSS merged into the HTML a bit. Where that line is, is certainly up for debate (and I don't have the answer), but I've found a lot of my tailwind sites are more readable to me than my pre-tailwind sites, often because I don't have to context-switch and open a different file to be able to reason about the styling on an element. For big stuff the second file can be nice, but there's a lot of style tweaking that is great to be able to do right there in the HTML. Tailwind does really lead you to ignore the css file though (or keep it highly minimal), which I agree is becoming an anti-pattern.

TonyAlicea10 4 hours ago | parent | next [-]

The "open a different file" reasoning piece is a common pro-Tailwind statement and I do see the upsides.

I think that upside became more prevalent in the reusable components era, whereas previously CSS was targeting an entire HTML file (and thus the reasoning was more like SQL query than "this one element's styling").

With LLMs I think this upside is much smaller now though.

reaperducer 3 hours ago | parent | prev | next [-]

I don't have to context-switch and open a different file to be able to reason about the styling on an element

Unless you're coding on a VT100 terminal, you just put the HTML in one window and the CSS in another. Subdivide as necessary, or as your monitor space allows.

Heck, we were doing that back in 1989 on IBM PCs with MDA displays.

If your CSS is so out of control that you can't wrap your brain around it, it's time to refactor or split into individual CSS component files.

afiori 2 hours ago | parent [-]

Maybe even split it into a set of small reusable coherent utility classes

skydhash 4 hours ago | parent | prev | next [-]

It seems that everyone is forgetting the web inspector as a tool for designing web pages. You can tweak properties and styles in a live environment, and then transfer your preferences to the css files.

hikosan 3 hours ago | parent | prev [-]

[dead]