Could this resolve CSS variables? #747
Replies: 2 comments 2 replies
-
You can probably use our sister package Emogrifier for this. This inlines the CSS as style attributes directly in the HTML, resolving all CSS rules. Originally intended for email clients that have poor CSS support, it should work just as well to help out other applications with limited CSS support. However, support for CSS custom properties has only just been added, and is not yet in a released version. You could try with the The readme on the GitHub page includes the details for resolving CSS variables. Let us know if you have any questions or issues. |
Beta Was this translation helpful? Give feedback.
-
Closing, as we now have both an answer as well as an Emogrifier release. |
Beta Was this translation helpful? Give feedback.
-
I have a style sheet that relies on CSS variables (aka custom properties). Now I want to generate PDFs with mpdf, which doesn't understand those. Instead of writing a custom style sheet for the PDF export I was wondering if there's a way to automate.
Would it be possible to use this library to create stylesheet that resolves all the variables to their appropriate values? Has anyone done this before and could give some pointers or example code?
Beta Was this translation helpful? Give feedback.
All reactions