5 ms·
I think the primary advantage of tailwind comes when you use it with JS components e.g. React, Vue, etc. Instead of writing ".widget a" which will leak into it
by trinovantes 5y ago
I think the primary advantage of tailwind comes when you use it with JS components e.g. React, Vue, etc.
Instead of writing ".widget a" which will leak into its child components' anchor tags, you just directly style the anchor tags of the parent widget <a class="bold text-center">
This keeps css simple and isolated so you don't need to waste time trying to figure out the specificity to override some style
- linkdd 5y agoI don't know for React/Angular, but with VueJS you have: <style scoped> .a-class-that-will-not-leak { /* ... */ } </style> Considering this feature, what's the difference between writing CSS properties or using Tailwind's @apply ? Also, such CSS classes are also available in frameworks like Bootstrap or Bulma: <a class="has-text-weight-bold has-text-centered"> But they also give me: <nav class="navbar"> ... </nav> Which would be responsive and functional, unlike the one I would implement with homemade CSS.
- Graffur 5y agohttps://github.com/css-modules/css-modules https://github.com/css-modules/css-modules solves this in React. Although that repo hasn't been updated in years