Closed danielmoessner closed 2 years ago
Hello!
The best way to know what’s going on is to use logging
: you’ll know why WeasyPrint doesn’t load the CSS file.
And if you use Django with WeasyPrint, you can try Django-WeasyPrint!
@danielmoessner Did you find the time to try the logging
module?
Sorry, I haven't tried it again yet. Not sure when I'll find the time, as for the moment it works with CSS(). I'll close this issue for now and reopen as soon as I find out more.
@liZe thanks for your insight. With logging i was ablel to finally see why weasyprint wasn't applying my tailwindcss stylesheet to my pdf output file. I have attached the log file incase you have any solution steps to offer. Thanks
Hi @ethernalarts,
According to your logs, the main problems are:
var
unsupported in some cases (#1219),-webkit-*
and -moz-*
values, etc).(The warnings are quite self-explanatory, aren’t they?)
Hi @ethernalarts,
According to your logs, the main problems are:
var
unsupported in some cases (Handle functions (var, attr…) in properties with multiple values #1219),- ignored media queries based on sizes (Support media queries #494),
- various unsupported CSS properties (CSS box-shadow and text-shadow #13, many
-webkit-*
and-moz-*
values, etc).(The warnings are quite self-explanatory, aren’t they?)
Hello @liZe ,
Thank you for your prompt response and links. Yes, i guess they are quite self-explanatory. The volume of errors can be overwhelming at times. I'll check out your links and get back to you. Once again thank you.
Using weasyprint 53.4 inside a django project
I've had the following code, which failed in production inside a docker container: html
python: BACKEND_URL looks like https://api.example.com
and the styles were applied correctly locally in development mode, but it all failed once i've put it inside a docker container and deployed.
Now this always works:
Might there be a reason why the css doesn't load inside a docker container?
I've thought it might have to do with ALLOWED_HOSTS in django, because weasyprint might make a request to the application itself to get the css file, but that doesn't seem to be the case. I don't know how weasyprint loads the css files within the html file.
I'm curious on what's going on here.