DEV Community

Discussion on: What tools/frameworks do you use for styling you web app?

Collapse
 
barelyhuman profile image
Reaper

You do end up doing the same but with whatever framework you use, anyway.
If in react/svelte/vue , you'll create components that have their own sets of tailwind styles on the component and then you use the component everywhere.

The only tailwind classes repeated everywhere are the layout ones (margins/display/padding,etc)

All i'm doing is, making it easier to move the components across codebases, I can use the above in a server rendered golang based codebase or a laravel codebase and not have to re-write the design system for every framework I decide to experiment with.

another way to do this is to use web components but I don't see the performance benefit since they won't work on older browsers, hence the above approach.

I've got my own utilities for layouts for react and react native so I don't have to deal with tailwind classes and inline styles separately in both codebases, that's one case where I don't mind getting locked to the 2 libraries (react and react native)

Anyway,
tailwindcss.com/docs/reusing-style...

tailwind does recommends using it when needed.