3 ms·
The solution is already here, and it's totally fine: Use utility classes just for layout (margin, padding, etc); use scoped styles for your components; use a sm
by montroser 1y ago
The solution is already here, and it's totally fine: Use utility classes just for layout (margin, padding, etc); use scoped styles for your components; use a small set of globally available classes for styling native elements (buttons, etc) -- and you're good!
Vue and others have had scoped styles for a long time. Now @scope is spec'd with improving browser support. All this pain in TFA is from people flailing with all of the many bad options that pervade the React ecosystem.
- deleted 1y ago[deleted]
- pier25 1y agoThis is how I write css. In a couple of years people will wonder why anyone would use something like Tailwind.
- owebmaster 1y agoThe utility classes can be tailwind
- pier25 1y agoExcept that tailwind is a huge dependency. Not only it requires a compiler, but editor extensions, plugins, and learning a whole new language to express css.
- owebmaster 1y agonot when you use unocss (and tailwind4, I think, but I don't use it).
- omnimus 1y agoI think this is good advice. I would say many people end up in that style. Downside is that you have to be pretty experienced with CSS to get this right as it doesn't always give obvious solutions. It's often "it depends".