There’s a big caveat to Tailwind: It generates styles at build time.

So if you try styling your elements with dynamic classes like bg-${color}, it just won’t work, you need to write out the full class name for Tailwind to pick it up.

That’s fine for a lot of apps, but it becomes a real challenge when you’re building things like visual editors, customizable dashboards, or anything that needs dynamic, interactive styling.

The good news is that you can still make it work if you understand how Tailwind works under the hood.

That’s why I wrote this blog post, where I show how to:

  • Understand how Tailwind generates styles
  • Mix inline styles with utility classes
  • Use safelisting in v4.0
  • Apply all this for visual editors like Puck