-
I am having trouble generating a background color for a PDF in wkhtmltopdf. Apparently writing as background-color: rgb(240 249 255 / var(--tw-bg-opacity)); causes wkhtmltopdf to not be able to interpret it correctly. I tried using plugins "postcss-color-rgba-fallback", "postcss-rgba-hex" but they have the same problem - by using --tw-bg-opacity they don't recognize the value correctly. Is it possible to force tailwind to generate colors directly as hex? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @xorock, I encountered the same issue. I just disabled the core corePlugins: {
+ textOpacity: false,
+ backgroundOpacity: false,
+ borderOpacity: false,
} If there are other issues with opacity, try disabling other core plugins. You can find all core plugin related logic here Hope it helps. |
Beta Was this translation helpful? Give feedback.
-
Oh man. I've just updated to tailwind 4 and previously I had needed this solution to make my html render in wkhtmltopdf. Now with the corePlugins option removed from tailwind 4, the entire thing has collapsed. What are the chances someone might understand what is happening with v4 now and how I might get things to work again. I'm happy to edit my html, or configure tailwind - but I don't know what I need to be doing to replicate what disabling those plugins in v3 was doing. @sudkumar Any ideas? |
Beta Was this translation helpful? Give feedback.
Hi @xorock, I encountered the same issue. I just disabled the core
*Opacity
plugins for the things that breaks the pdf generation. Here is the minimal configuration:If there are other issues with opacity, try disabling other core plugins. You can find all core plugin related logic here
Hope it helps.