Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window.print() changes theme to light mode #188

Closed
oncet opened this issue Jun 30, 2023 · 1 comment
Closed

window.print() changes theme to light mode #188

oncet opened this issue Jun 30, 2023 · 1 comment

Comments

@oncet
Copy link

oncet commented Jun 30, 2023

Theme changes to light when calling window.print() if current theme is set to system and resolvedTheme is set to dark (i.e. OS is set to dark mode). After closing the print dialog the theme returns to dark. Using cmd + p doesn't affect the current theme.

Only seems to happen when using the Pages Router.

Here is a CodeSandbox to try it out:

Not sure if this is a bug or an un-documented feature.

Maybe related to #6.

@trm217
Copy link
Collaborator

trm217 commented Apr 22, 2024

I would assume that window.print() causes a re-render of the page that doesn't execute JS and therefor doesn't apply the dark-mode attribute and therefor doesn't update the colors.
Closing for now :)

@trm217 trm217 closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants