So we have known all along that this will never happen. It was rejected for some very good reasons before Tailwind began.
Feedback welcome
Sometimes, they are, and should be, separate. But in other cases, styling is related to the content, or part of it.
You have a card? Boom, you need to couple styles for the title, for the content, for the footer etc.
You have a form? Boom, you need to couple styles with the form.
The idea that styles are somehow decoupled from content is funny idea that very rarely works out in practice.
Would you copy paste around:
<form class="asd fasdf e4rwe sfdg sdfgbbv cxvbxcs asdf asdf wer wer gfdghdfgh fgh">
20x around your static website and keep it updated manually when someone "from design" wants to change the "form" look?
Or would you just <form class="classic-form"> and describe the style of that class of form in a single place?
I know what I'd do. :)
My argument is that React is actively bad for writing HTML/CSS, and therefore people came up with clunky solutions to get around those limitations. Certainly Tailwind is more than just a solution for React, but a large part of its popularity is due to it.
Why do people keep mentioning Tailwind and CSS-in-JS in the same sentence?
And no, Tailwind would still have its place even if Svelte appeared first because instead of writing the same styles everywhere you'd still want to extract them into a file, and have sensible defaults for them.
Oh look, Tailwind does exactly that.
Because one of the biggest arguments for each is scoping styles to a component instead of the default global cascade.
> And no, Tailwind would still have its place even if Svelte appeared first because instead of writing the same styles everywhere you'd still want to extract them into a file, and have sensible defaults for them.
Writing same styles everywhere? I'm not sure I understand what you mean, that isn't related to Tailwind or frameworks. Sensible defaults are just design system tokens, those are usable in way more styling approaches than just Tailwind.
I'm not saying Tailwind wouldn't exist, I'm saying it wouldn't be as wildly popular as it is now. React's lack of CSS features has encouraged a generation of frontend devs to simply not learn CSS fully. Sure you need to know some CSS to use Tailwind, but in many cases people just copy-paste Tailwind templates from elsewhere (another benefit of Tailwind) and don't actually understand the styling. I see Tailwind classes that do nothing in the wild all the time.
Escaping the global cascade has been on everyone's mind since forever. BEM, one of the lost popular ways to try and scope CSS to components, was invented in 2006: https://en.bem.info/methodology/history/
OOCSS is 2009: https://www.slideshare.net/stubbornella/object-oriented-css
> Writing same styles everywhere? I'm not sure I understand what you mean,
You need to specify things like font sizes, line heights, border styles, colors etc.
> React's lack of CSS features has encouraged a generation of frontend devs to simply not learn CSS fully.
This has nothing to do with React. No one ever learned CSS fully. If anything, Tailwind encourages you to learn more CSS.
> but in many cases people just copy-paste Tailwind templates from elsewhere (another benefit of Tailwind) and don't actually understand the styling.
How different is it from all the history of the web?