astefanutti / decktape

PDF exporter for HTML presentations
MIT License
2.16k stars 175 forks source link

Remark custom styles not applied on PDF #310

Closed gillchristian closed 9 months ago

gillchristian commented 10 months ago

Here's a Remark presentation https://remark-custom-css.vercel.app/

In the last two slides I have some custom CSS to display the pictures side by side or in a grid.

Here's the source code https://github.com/gillchristian/remark-custom-css/blob/master/index.html

However in the PDF the styles aren't applied:

Here's the generated file: https://github.com/gillchristian/remark-custom-css/blob/master/deck.pdf

I generated the file with Docker:

docker run \
  --rm -t \
  --net=host \
  -v `pwd`:/slides astefanutti/decktape remark https://remark-custom-css.vercel.app/ deck.pdf

Note: the print pdf (ie. "Save as PDF" from Chrome's print page menu) does respect the styles https://github.com/gillchristian/remark-custom-css/blob/master/print-pdf.pdf

astefanutti commented 9 months ago

The Remark plugin used to manipulate CSS rules to work-around some issues, but that does not seem to be necessary anymore.

I've created #313, that results with the following PDF for your presentation: test.pdf.

I need to to some more testing to make sure that doesn't introduce any regression.

gillchristian commented 9 months ago

Ohh that's awesome! Thanks for the quick fix as well!