These are things that CSS literally solved with the web2.0/semantic-web movement 20 years ago. I get the convenience of Tailwind but a lot of it feels like a massive step backwards.
But yeah take say a dashboard layout with a lot of cards of different sizes. They're going to have the same underlying design, padding, rounded edges, background colors, etc -- and usually only vary on maybe size and breakpoints.
This is all very well solved in semantic web, but it feels to me like the JS + Tailwind apporach is creating new problems and thus new solutions to accompany.
If it was solved with "semantic web" (whatever that means), we wouldn't have people attempting to solve this again, and again, and again.
All "semantic web" can provide is a flat CSS namespace and a bunch of nested divs.
Even if you do everything right there's nothing semantic about it: https://inclusive-components.design/cards/
Remember when serverless got invented even though CGI already existed?