react-to-print icon indicating copy to clipboard operation
react-to-print copied to clipboard

Styled not showing in dark mode

Open waptik opened this issue 2 years ago • 3 comments

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

waptik avatar Mar 29 '22 12:03 waptik

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

MatthewHerbst avatar Mar 31 '22 22:03 MatthewHerbst

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: @.***>

waptik avatar Apr 01 '22 00:04 waptik

Same for me with tailwind and create-react-app v18

singhkunal2050 avatar Apr 18 '22 11:04 singhkunal2050

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

MatthewHerbst avatar Jun 01 '23 04:06 MatthewHerbst

Facing the same issue while using material UI components

amarstb avatar Feb 28 '24 09:02 amarstb

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!

MatthewHerbst avatar Feb 29 '24 01:02 MatthewHerbst