quasar icon indicating copy to clipboard operation
quasar copied to clipboard

[15.10] Bug or Feature Request: CSS visibility width classes do not work in media print mode.

Open Lou-Der opened this issue 8 years ago • 5 comments

All elements tagged with the quasar css width classes like "lt-md" or "gt-mt" behave like window breakpoints are now XS when in print media mode.

I would expect the printout to represent current screen layout except where using "print-only" and "print-hide" css classes.

Anyone have an idea on how to handle this?

Thanks!

Lou-Der avatar May 10 '18 20:05 Lou-Der

Hi. Yes, because the print page has different size.

rstoenescu avatar May 10 '18 20:05 rstoenescu

I guessed window size was the issue, though there is no way the printout is going into that small of a width...

How about adding a print-always css class then? That way we can hide and force what elements are printed regardless of screen size.

Lou-Der avatar May 10 '18 20:05 Lou-Der

I think you are missing the point. The print page is still a page. So it's up to the developer to write a css print media query to tweak things however he/she wants if the default does not fits the needs. That's if the "print-only" or "print-hide" CSS classes are not enough. There's no golden solution -- and it's outside of Quasar's responsibility, as the scenarios are endless.

rstoenescu avatar May 10 '18 21:05 rstoenescu

Understood, was just suggesting adding the missing piece to your already created printer related CSS classes.

I've already fixed my code to deal with this using my own print-always class:

@media print {
       .print-always {
         display: block !important;
       }
     }

Lou-Der avatar May 10 '18 21:05 Lou-Der

Framework code needs to be as generic as possible. "display: block" might work for your particular case, but what if the DOM element initially has "display: flex"? And it goes on and on and on :)

rstoenescu avatar May 10 '18 21:05 rstoenescu