After working with Tailwind for a period of time I came to the exact same conclusion. You can achieve all of this in a better way using CSS variables. You can transform this:
Adjust variable names to taste. No build step, no extra tooling, just as readable in my opinion. On top of that, using CSS variables means that those values can be changed at runtime. You basically get user-driven theming for free.
I'm building an app like this right now and it's been lovely.
I'm on mobile so forgive me for not giving more extensive code examples. In my case, I'm building my app with React, TypeScript, and react-jss. I've got an enum which stores my common media queries and I just use it in the style declaration.
button: {
[MediaQueries.Medium]: ...
}
I can't use CSS variables for that but I personally don't think it's useful to let the user redefine those queries anyway
I'm building an app like this right now and it's been lovely.