Replies: 2 comments
-
You could consider using |
Beta Was this translation helpful? Give feedback.
-
Hey! 👋 You're absolutely right — when you're using Tailwind CSS (especially with v3+ and v4), any class names that are dynamically generated via string manipulation (like 🔥 Why this happensTailwind's JIT engine scans your code for actual class names. So if you're dynamically constructing class strings at runtime (like inside a dropdown or loop), Tailwind has no way of knowing which variants to keep during build time — and it throws them out to keep the CSS lean. ✅ Solution: Safelist the ColorsYou do need to safelist them, unless you hardcode every class. Here’s how to do it: 1. Open your
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Howdy, using V4 im trying to create a compeoent to show all the taiwlind colors for choosing from a dropdown. i got everything working but i think i have t safe list all the colors , because they are purged and the comp uses string maipulation to show all colors... do i need to safe list, if so.. how ? is there a ready made hack to do that ?
Thansk!
Beta Was this translation helpful? Give feedback.
All reactions