nuxt / devtools

Unleash Nuxt Developer Experience
https://devtools.nuxt.com
MIT License
2.79k stars 154 forks source link

feat: hide devtools when printing #648

Closed anbraten closed 2 months ago

anbraten commented 3 months ago

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 commented 3 months ago

How about doing it with CSS directly?

anbraten commented 3 months ago

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

@media print {
  #nuxt-devtools-container {
    display: none;
  }
}
antfu commented 3 months ago

You can put it here: https://github.com/nuxt/devtools/blob/101d7de7754cabc5330a95843f4e5b32c6479ae7/packages/devtools/src/runtime/plugins/view/Main.vue#L558

anbraten commented 2 months ago

Added it to the suggested place and seems to work.