Open jgosmann opened 10 months ago
For what it is worth, we could workaround our issue by importing import { isPrintMode } from '@slidev/client/logic/nav.ts'
and using that to attach an additional CSS class to modify the styles for the PDF export.
Describe the bug I am using some CSS styles (gradient on a text) that work well in browsers, but are displayed wrong (to varying degrees) in PDF readers when exporting the presentation to PDF. I attempted to remove the gradient (as graceful degradation) for the PDF export with an
@media screen
CSS media query, assuming that the PDF export would be "print" media. However, this does not work because apparently the PDF export emulates "screen" media.Maybe this is desired to keep the export as close as possible to the web version. But to me it seems a valid use case to wanting to adjust some styles solely for the export to make them more suitable for actual printing or achieving better compatibility with a wider range of PDF viewers.
If it is agreed upon to change this behavior, I would be willing to prepare a PR for the change.
To Reproduce Steps to reproduce the behavior:
@media print { background: red; }
or@media screen { background: blue; }
).Desktop (please complete the following information):