marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 545 forks source link

CSS Grid Styles is not working? #624

Open dafapramudya opened 3 years ago

dafapramudya commented 3 years ago

Hi! @marcbachmann and everyone :smiley:

Is CSS Grid Styles hasn't working on node-html-pdf?

So, I try this template:

template.html

Preview template.html:

image

But I got this result at the document:

image

When it generated, it looks like this style has been removed:

image

Any suggestions? please help. Thank you!

latobibor commented 3 years ago

Hi @dafapramudya!

node-html-pdf is using phantomjs-prebuilt to render HTML which is a discontinued package. That means that newer CSS features will never be adapted.

sorawitw commented 3 years ago

display flex too? @latobibor

Israel-oduguwa commented 3 years ago

Its Not working because of the css code, you need to use --webkit css, but i use css Autoprefixer to get the css Autoprefixer

latobibor commented 3 years ago

@sorawitw

display flex too?

Actually it works but beware because flex and page boundaries are not really working well together. (The former ignores the latter).

You can get the gist of the problem from this old question: https://stackoverflow.com/questions/20408033/how-to-get-page-break-inside-avoid-to-work-nicely-with-flex-wrap-wrap

sorawitw commented 3 years ago

Thank you for your help both @Israel-oduguwa and @latobibor :)