DEV Community

Create PDFs with Tailwind

Titouan Launay on March 21, 2024

As a developer, creating PDFs seems like a simple task. We build frontends with modern toolkit in just hours, how could static documents be any har...
Collapse
 
sampsonprojects profile image
Sampson Crowley

Tailwind does not require JS to be generated any more than react... It requires JS for JIT compilation

You can just use the full framework with all of the classes. This is even already the default in development. The classes aren't stripped and minified until production build

Collapse
 
titou325 profile image
Titouan Launay

This is partly true. The main focus here is handling user-generated content and themes, and this requires JIT compilation as you can't rely on your build step to provide the needed classes - even if using the whole bundle as you will still miss dynamic syntax classes such as margin-[1cm].

There are other approaches and you can also pass along your whole css bundle if you don't need to support dynamic components :)