You didn't understand the idea of a utility framework like tailwind. It doesn't replace CSS-modules, CSS-in-JS, BEM, or any other methodology. Over time it's a blessing to work with because you write much fewer custom selectors. This results in a standardized way of how base styles (font, grid, margin, padding, color) are applied to your components. This makes your components more readable and maintainable.
But if you write it this way, would that inline the classes anyway in the output or not? And what about purge? Would it still work this way removing unused stuff without having the classes applied to the HTML directly?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You didn't understand the idea of a utility framework like tailwind. It doesn't replace CSS-modules, CSS-in-JS, BEM, or any other methodology. Over time it's a blessing to work with because you write much fewer custom selectors. This results in a standardized way of how base styles (font, grid, margin, padding, color) are applied to your components. This makes your components more readable and maintainable.
You code can also be written as:
But if you write it this way, would that inline the classes anyway in the output or not? And what about purge? Would it still work this way removing unused stuff without having the classes applied to the HTML directly?