4 ms·
Concatenating Tailwind classes is a huge code smell. While you can safe list them, I've personally never done anything where I felt that it was worth the effort
by stefanfisk 4y ago
Concatenating Tailwind classes is a huge code smell. While you can safe list them, I've personally never done anything where I felt that it was worth the effort compared to just listing all possible classes.
- danielvaughn 4y agoI like to use a library called classnames. It lets you define dynamically-applied classes in a much more readable way. https://www.npmjs.com/package/classnames https://www.npmjs.com/package/classnames
- vehemenz 4y agoA good middle ground is to have your linter sort the classnames in a reasonable way. I prefer the “outside in” method. This keeps things readable enough so you can find classes where you expect them.