Having a name for each element in your markup is really powerful and useful, and it seems like the Tailwind approach exists specifically to avoid having to name things.
Having a name for each element in your markup is really powerful and useful, and it seems like the Tailwind approach exists specifically to avoid having to name things.
This makes it so you don't have to remember all the names specific to the project (or learn an existing projects css names).
I've never used Tailwind myself so I am not advocating it per say, just explaining how I understand it.
You guessed it right. There is no need for named selectors anymore.
And you get the advantages of standardisation. People can share snippets of code you can reuse as is.
And when you have a problem, you are probably not the first to have it, and can quickly find a solution on youtube, stack overflow, etc.
[1] https://vincenttunru.com/why-tailwind/#the-right-abstraction
I know this is controversial because of the web dev canon of "lol CSS sucks", but many people really love CSS, and find it incredibly powerful and enjoyable to use. If you put in the time to truly learn it, these tools seem silly and redundant.
Otherwise, you're just improvising.
In my experience you tend to end up in a weird thought experiment trying to work out what the third child of the body of a card should be called when actually you just want it to be bold with some padding.
As other people have said, naming things also becomes totally redundant when you’re using something like React or Vue where the abstraction is a component which is itself already named.
[0] https://tailwindcss.com/docs/extracting-components#extractin...