react-to-print
react-to-print copied to clipboard
Styled not showing in dark mode
Hi. I came across this library yesterday after trying various libs without result. I am using this lib along with nextjs and chakra-ui and they work great. But one issue I am facing is that when I enable dark mode, the styles don't show up in both the preview and downloaded pdf file. My app itself uses dark mode and it's one of its core features. Is there a way around it?
Here's a live reproduction of my use case: https://codesandbox.io/s/quizzical-browser-jcvyjb
Hey, looking into it. My guess is chakra-ui, like many component libraries, does some weird things with print styles. Will let you know what I find, but I probably can't dive into it until this weekend
Oh ok, no problem. No hurry with that. I'll just have to delay the printing feature for now(not a major one)
On Thu, Mar 31, 2022, 22:00 Matthew Herbst @.***> wrote:
Hey, looking into it. My guess is chakra-ui, like many component libraries, does some weird things with print styles. Will let you know what I find, but I probably can't dive into it until this weekend
— Reply to this email directly, view it on GitHub https://github.com/gregnb/react-to-print/issues/478#issuecomment-1085167955, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM377ZWSMFNJJJQ4ZNTDL3VCYOBHANCNFSM5R6JPXHQ . You are receiving this because you authored the thread.Message ID: @.***>
Same for me with tailwind and create-react-app v18
I'm no longer able to reproduce this issue: printing from the original example when in dark mode correctly creates a print preview with dark mode, and when saving to PDF via chrome, the saved PDF has the correct dark mode theme. Please let me know if this is still an issue and happy to re-open and look into it further
Facing the same issue while using material UI components
Facing the same issue while using material UI components
Could you please provide reproduction steps, or ideally a working demo? At minimum I would expect to know what dependency versions you are using. Thanks!