▲ | hasanhaja 4 days ago | |||||||
How's your experience maintaining styles written in this manner? My experience has been increased cognitive load when I come back to tailwind styles after a long time, when compared to dealing with handwritten CSS selectors and classes | ||||||||
▲ | switz 4 days ago | parent | next [-] | |||||||
To the contrary, far less cognitive load. I don’t have to internalize a class name and where it lives in a style sheet and then context switch between the two. | ||||||||
| ||||||||
▲ | vehemenz 4 days ago | parent | prev | next [-] | |||||||
I don't see how that's possible. My experience has been the exact opposite. When you say "handwritten CSS selectors and classes," what you really mean is learning a unique codebase with high levels of abstraction that map on to the DOM in a structured way that cannot be automatically inferred. It has to be learned by looking at both the CSS (often buried in many component files) and how the components are implemented in the DOM. In large projects, this is far from trivial. And I think that's the key. When people say "handwritten" CSS is either, what they mean is that their small project, with no other contributors, is easier to manage. When picking up a Tailwind project, what's to learn again? You might forget some of the class names, but if you already know the CSS properties, you're 80% there. With your IDE's completion, you're 90%. And crucially, no context switching whatsoever. | ||||||||
▲ | const_cast 4 days ago | parent | prev [-] | |||||||
Classic CCS styles have zero maintenance burden, because they're never maintained. They're treated as read-only and every dev just tacs on and then you have 20 different buttons. In my experience. |