-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathprint.scss
139 lines (121 loc) · 2.41 KB
/
print.scss
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
129
130
131
132
133
134
135
136
137
138
139
/**
* print.scss - Common CSS classes to apply for print version
*
* @version 2.4.1
* @package tpl_lyquix
* @author Lyquix
* @copyright Copyright (C) 2015 - 2018 Lyquix
* @license GNU General Public License version 2 or later
* @link https://github.com/Lyquix/tpl_lyquix
*/
// Normalize print styles
@media print {
// Avoid breaking fixed-width text blocks and quotes
code,
kbd,
pre,
samp,
blockquote {
page-break-inside: avoid;
}
// Add table header on every page, and avoid breaking rows
thead {
display: table-header-group;
}
tr {
page-break-inside: avoid;
}
// Avoid breaking images
img {
page-break-inside: avoid;
}
// Allow up to 3 orphan/widow lines
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
// Don't break right after a heading'
h1,
h2,
h3,
h4,
h5,
h6 {
page-break-after: avoid;
}
}
// Page break classes
.page-break-before-always { page-break-before: always; }
.page-break-before-avoid { page-break-before: avoid; }
.page-break-after-always { page-break-after: always; }
.page-break-after-avoid { page-break-after: avoid; }
.page-break-inside-avoid { page-break-inside: avoid; }
// Hide in print
.print-hide {
@media print {
&, *, *:before, *:after, *:first-letter, *:first-line {
display: none !important;
}
}
}
// Remove background color and images
.print-no-background {
@media print {
&, *, *:before, *:after, *:first-letter, *:first-line {
background: transparent !important;
background-image: none !important;
}
}
}
// Force text to full black
.print-text-color-black {
@media print {
&, *, *:before, *:after, *:first-letter, *:first-line {
color: #000 !important;
}
}
}
// Remove box shadow
.print-no-box-shadow {
@media print {
&, *, *:before, *:after, *:first-letter, *:first-line {
box-shadow: none !important;
}
}
}
// Remove text shadow
.print-no-text-shadow {
@media print {
&, *, *:before, *:after, *:first-letter, *:first-line {
text-shadow: none !important;
}
}
}
// Appends the URL after links (except anchors and javascript)
.print-links-href {
@media print {
&, a {
&:after, &:visited:after {
content: " (" attr(href) ")";
}
&[href^="#"],
&[href^="javascript:"] {
&:after, &:visited:after {
content: "";
}
}
}
}
}
// Appends title after abbreviations
.print-abbr-title {
@media print {
&, abbr {
&:after {
content: " (" attr(title) ")";
}
}
}
}