(core) Add some media queries to improve printing

Summary:
- Hides left and right panels and the top bar
- Hides cursor and active-section highlight
- Hides "=" icon on formulas
- Nudges browser to include background for row/column headers, which is not
  otherwise included.

Still only what's visible is printed (e.g. large tables not paginated).

Test Plan: Tried a few pages manually on Firefox and Chrome.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2579
This commit is contained in:
Dmitry S 2020-08-07 17:53:53 -04:00
parent 3c9ff4a703
commit 4e20f7a8a2

View File

@ -139,6 +139,11 @@ export const cssLeftPane = styled(cssVBox, `
min-width: 160px; min-width: 160px;
max-width: 320px; max-width: 320px;
} }
@media print {
& {
display: none;
}
}
`); `);
const cssMainPane = styled(cssVBox, ` const cssMainPane = styled(cssVBox, `
position: relative; position: relative;
@ -160,6 +165,11 @@ const cssRightPane = styled(cssVBox, `
min-width: 240px; min-width: 240px;
max-width: 320px; max-width: 320px;
} }
@media print {
& {
display: none;
}
}
`); `);
const cssTopHeader = styled('div', ` const cssTopHeader = styled('div', `
height: 48px; height: 48px;
@ -168,6 +178,12 @@ const cssTopHeader = styled('div', `
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid ${colors.mediumGrey}; border-bottom: 1px solid ${colors.mediumGrey};
@media print {
& {
display: none;
}
}
`); `);
const cssResizeFlexVHandle = styled(resizeFlexVHandle, ` const cssResizeFlexVHandle = styled(resizeFlexVHandle, `
--resize-handle-color: ${colors.mediumGrey}; --resize-handle-color: ${colors.mediumGrey};