Tav, I’ve been asked to build a page to house an annual report for the NGO that I volunteer at.
I’m using Sidebar within full screen Section Pro sections.
It works fine on both desktop and mobile devices and the “client” loves it.
The page needs to saved as a PDF so that interested parties can download it.
When printing or saving to PDF, the right hand column of each section is printed above the left hand column.
Firstly, if you wanted forms or layouts that were columnar in printable documents (which usually tend to be things like invoices, tickets, booking information etc) then they would have been constructed using tables and not columns and so would print as per their desktop appearance.
Secondly, with anything other than 2 columns, it is likely that it would become unreadable or overflow the page margins unless it was stacked as a block. By necessity, a framework has a set of rules that are more general and so the “lets stack all columns on mobile” was probably the best solution (especially given point one above).
Changing the restriction of the media query from screen to all may not behave as you expect. When you print a document, a width controlled breakpoint targeting all will print however it is displayed on screen - i.e. a direct facsimile. Is this what you want? To be clear, if you have a wide browser and an extra large layout enabled in sidebar then this will be replicated in print when you press print.
Conversely, if you need to define a completely separate layout for print then this would need an entirely separate media query and its own settings. Bootstrap 3 used to get around this by using the XS settings for printing which was almost universally unpopular.
This method, of course, requires knowledge of the size of the media on which it is to be printed. This is more suitable to invoices / tickets etc where you are always printing to the same sized paper in the same orientation and the end user does not have any ability to change this
It all really depends on how you want it to work in practice.
My layout has two columns. Currently the right column prints above the left column regardless of the VP width — which doesn’t enable a readable flow.
What I had expected is that — as with the mobile break, the print flow would be vice-versa.
If the columns were printed beside each other, that would also be acceptable. It would result in smaller print, but that can be compensated on a larger screen as is nowadays more usual
The stacking order can now be matched to follow the desktop - I’ve already noticed that error and fixed it regardless of the above discussion.
Having seen that layout, I would say that it could work either way. The safe bet is to stack it for print - this will ensure that everything is readable - remember that font scaling will not necessarily be the same for print as for screen width.
Alternatively, if you trust users to be given the choice, we can make it follow the desktop layout and they can print whatever layout is visible in the browser when the print menu is selected. This has the advantage that the fonts and sizes of other elements will also work.
Most users would expect it to print as it appears on their screen but that is neither here nor there. They would get a pretty horrible and unreadable result printing it landscape if it all stacked automatically. Given that you don’t know the media size or orientation that they are printing on then I don’t really see how you can make a rational decision on it other than to leave it to the user.
If we want to enforce the small (stacked) layout for print (always) then we need to duplicate pretty much all of the code as it will have to go into a separate media query. We cannot use the all or screen targets for our queries due to the way that the flex box ordering works.
In such instances, my recommendation would therefore to use a simple Foundation column or Grummage which will do this by default.
Otherwise, I have DM’d you a revised SideBar that uses all rather than screen and so will stack in the order as per the stack settings but follow the layout of the browser when printed.
There are no easy answers to this without creating a dedicated page to print from with option buttons for users to select portrait / landscape etc.