/
hexagon-print.css
128 lines (110 loc) · 2.22 KB
/
hexagon-print.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
@media not print {
.hx-print-only {
display: none;
}
}
@media print {
/* Fix layout and font size issues with root elements */
html,
body {
font-size: 12pt;
height: auto;
page-break-after: avoid;
}
/* Force body to display in print-friendly mode */
body {
background: transparent !important;
color: black !important;
margin: 0 !important;
padding: 0 !important;
width: 100% !important;
}
/* Hide elements that should not be shown when printing */
.hx-no-print,
.hx-spinner,
.hx-spinner-wide,
.hx-heading,
.hx-sidebar {
display: none !important;
}
/* Box shadows display badly when printing */
* {
box-shadow: none !important;
}
.hx-footnote-ref {
display: inline-block;
font-size: 0.8em;
font-style: italic;
margin-top: -0.5em;
}
/* Attempt prevention of page breaks inside important elements */
h1, h2, h3, h4, h5, h6,
table,
ul,
svg,
img,
form,
input,
.hx-footnote-links,
.hx-data-table,
.hx-card,
.hx-form,
.hx-table,
.hx-graph,
.hx-meter {
page-break-inside: avoid;
}
/* Attempt prevention of page breaks after heading elements */
h1, h2, h3, h4, h5, h6,
.hx-footnote-links {
page-break-after: avoid;
}
/* Reset font sizes for print (relative to 12pt) */
h1 {
font-size: 250%;
}
h2 {
font-size: 175%;
}
h3 {
font-size: 135%;
}
h4 {
font-size: 100%;
font-variant: small-caps;
}
h5 {
font-size: 100%;
}
h6 {
font-size: 90%;
font-style: italic;
}
/* Prevent images flowing outside the printable area */
img {
max-width: 100% !important;
}
/* Remove the margin around content as this is handled by the print margin */
.hx-content {
margin: 0 !important;
padding: 0 !important;
width: 100% !important;
}
/* Style links to be bold so they are visible as links */
a:link:not(.hx-btn),
a:visited:not(.hx-btn) {
font-weight: bolder;
text-decoration: underline;
}
/* Set the page margin */
@page {
margin: 1.5cm;
}
}
/* Make most browsers show background colors etc. by default when printing */
@media print and (color) {
* {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}