Skip to content

feat: hide devtools when printing#648

Merged
antfu merged 3 commits intonuxt:mainfrom
anbraten:print
Apr 30, 2024
Merged

feat: hide devtools when printing#648
antfu merged 3 commits intonuxt:mainfrom
anbraten:print

Conversation

@anbraten
Copy link
Copy Markdown
Contributor

@anbraten anbraten commented Apr 8, 2024

Currently when printing a page in dev-mode with nuxt the holder to open the dev-tools will be printed as well which often results in additional empty pages containing just the holder.

Please let me know if I should adjust the approach to something else.

@antfu
Copy link
Copy Markdown
Member

antfu commented Apr 8, 2024

How about doing it with CSS directly?

@anbraten
Copy link
Copy Markdown
Contributor Author

anbraten commented Apr 8, 2024

Sure that would work as well. Any preferences where I should add it. Would add

@media print {
  #nuxt-devtools-container {
    display: none;
  }
}

@antfu
Copy link
Copy Markdown
Member

antfu commented Apr 8, 2024

You can put it here:

@anbraten
Copy link
Copy Markdown
Contributor Author

Added it to the suggested place and seems to work.

@antfu antfu merged commit 1be7b2d into nuxt:main Apr 30, 2024
@anbraten anbraten deleted the print branch April 30, 2024 13:11
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

Successfully merging this pull request may close these issues.

2 participants