Twout

twout-dev-thumbnail

Tailwind Classes Output

Twout is a utility function that mimics how Tailwind generates styles and returns the corresponding CSS as a string.

Instead of relying on Tailwind’s build process, Twout lets you dynamically generate styles from class names — anywhere.

Why does this exist?

Tailwind is an amazing framework, but it has one limitation:

There is no official way to generate Tailwind’s output CSS dynamically outside of its build process.

Twout solves that.

Use cases:

  • Create page-specific CSS instead of one global file
  • Store Tailwind classes in CMS fields
  • Generate Tailwind styles from APIs
  • Apply styles dynamically from database-driven content
  • Use Tailwind logic in non-standard environments