]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - skins/vector/print.less
MediaWiki 1.30.2
[autoinstalls/mediawiki.git] / skins / vector / print.less
1 @import 'variables.less';
2 @footerColor: #eee;
3
4 // We have to render the wordmark image before the print dialog is invoked, otherwise the image
5 // won't render in the printed file. Use a little hack to render the image outside the viewport
6 // and bring it in the viewport in print view.
7 .vector-experimental-print-styles {
8         .firstHeading {
9                 // We could also use a CSS background to display the logo.
10                 // The problem is that the logo won't be printed unless the user prints the background too.
11                 // Note. This specification does not fully define the interaction of :before and :after with
12                 // replaced elements (such as IMG in HTML). This will be defined in more detail in a future
13                 // specification. See https://www.w3.org/TR/CSS2/generate.html#before-after-content
14                 & when( @printLogo = 1 ) {
15                         &:before {
16                                 content: @printLogoUrl;
17                                 display: block;
18                                 height: ~'@{printLogoHeight}px';
19                                 left: -9999px;
20                                 line-height: 0;  // line-height is needed for correctly displaying the size of the content box.
21                                 margin-bottom: 20px;
22                                 position: absolute;
23                                 width: ~'@{printLogoWidth}px';
24                         }
25                 }
26         }
27 }
28
29 @media print {
30
31         /* These styles retain the existing typography in screen.less
32         In future (when deploying these styles) we may want to refactor skins.vector.styles
33         to apply certain styles in print as well as screen mode. */
34         #toc,
35         body.vector-experimental-print-styles {
36                 padding: 10px;
37                 font-family: @font-family-serif;
38         }
39
40         .printfooter,
41         #footer,
42         // Tables, thumbs and lists are sans-serif in print mode (unlike screen mode) because these will render
43         // more legibly on print media in a smaller font sizes
44         .thumb,
45         table,
46         ol,
47         dl,
48         ul,
49         h3,
50         h4,
51         h5,
52         h6 {
53                 font-family: @font-family-sans-serif;
54         }
55
56         .vector-experimental-print-styles {
57
58                 // Normalize Blue links in the article
59                 a {
60                         border-bottom: 1px solid #aaa;
61                 }
62
63                 .firstHeading {
64                         font-size: 25pt;
65                         line-height: 28pt;
66                         margin-bottom: 20px;
67                         padding-bottom: 5px;
68
69                         // Bring back the wordmark to the viewport (see above how it's rendered outside the viewport).
70                         & when( @printLogo = 1 ) {
71                                 &:before {
72                                         left: auto;
73                                         position: relative;
74                                 }
75                         }
76                 }
77
78                 // Headings
79                 .firstHeading,
80                 h2 {
81                         // To avoid the bottom border of section headings with floated elements
82                         overflow: hidden;
83                         border-bottom: 2px solid @pureBlack;
84                 }
85
86                 h3,
87                 h4,
88                 h5,
89                 h6 {
90                         margin: 30px 0 0;
91                 }
92
93                 h2,
94                 h3,
95                 h4,
96                 h5,
97                 h6 {
98                         padding: 0;
99                         position: relative;
100                 }
101
102                 h2 {
103                         font-size: 18pt;
104                         line-height: 24pt;
105                         margin-bottom: 0.25em;
106                 }
107
108                 h3 {
109                         font-size: 13pt;
110                         line-height: 20pt;
111                 }
112
113                 h4,
114                 h5,
115                 h6 {
116                         font-size: 10pt;
117                         line-height: 15pt;
118                 }
119
120                 p {
121                         font-size: 10pt;
122                         line-height: 16pt;
123                         margin-top: 5px;
124                         text-align: justify;
125
126                         // T175008
127                         // When a paragraph is surrounded by floating elements from both
128                         // sides, we want to make sure that there is at least some space
129                         // before showing the text. Otherwise, small lengths of text may show
130                         // between the surrounding elements, making the reading experience less
131                         // enjoyable. If there is not enough space the following code will push
132                         // the paragraph contents until after the floating element(s).
133                         @paragraphMinWidth: 120pt;
134                         &:before {
135                                 content: '';
136                                 display: block;
137                                 overflow: hidden;
138                                 width: @paragraphMinWidth;
139                         }
140                 }
141
142                 blockquote {
143                         border-left: 2px solid @pureBlack;
144                         padding-left: 20px;
145                 }
146
147                 ol,
148                 ul {
149                         margin: 10px 0 0 1.6em;
150                         padding: 0;
151
152                         li {
153                                 padding: 2px 0;
154                                 font-size: 10pt;
155                         }
156                 }
157
158                 // Using #toc rather than .toc to override default print style
159                 #toc {
160                         page-break-before: avoid;
161                         page-break-after: avoid;
162                         background: none;
163                         border: 0;
164                         display: block;
165
166                         a {
167                                 border: 0;
168                                 font-weight: normal;
169                         }
170
171                         > ul {
172
173                                 > li {
174                                         margin-bottom: 4px;
175                                         font-weight: bold;
176
177                                         > ul {
178                                                 padding-left: 0;
179                                         }
180                                 }
181                         }
182
183                         ul {
184                                 margin: 0;
185                                 list-style: none;
186
187                                 ul {
188                                         padding-left: 30px;
189
190                                         li {
191                                                 padding-left: 30px;
192                                         }
193                                         .tocnumber {
194                                                 min-width: 30px;
195                                         }
196                                 }
197                         }
198
199                         li.toclevel-1 {
200                                 > a {
201                                         font-weight: bold;
202                                         font-size: 10pt;
203                                 }
204                         }
205
206                         .tocnumber {
207                                 padding-right: 0;
208                                 text-align: right;
209                                 margin-right: 30px;
210                                 display: inline-block;
211                         }
212                 }
213         }
214
215         .printfooter {
216                 margin-top: 10px;
217                 border-top: 3px solid @pureBlack;
218                 padding-top: 10px;
219                 font-size: 10pt;
220         }
221
222         #footer {
223                 margin-top: 12px;
224                 border-top: 1px solid @footerColor;
225                 padding-top: 5px;
226         }
227
228         #footer-info {
229                 margin: 0;
230                 padding: 0;
231
232                 li {
233                         color: #999;
234                         list-style: none;
235                         display: block;
236                         padding-bottom: 10px;
237                         font-size: 10pt;
238
239                         a {
240                                 // override default black print style.
241                                 color: #999 !important; /* stylelint-disable-line declaration-no-important */
242                         }
243                 }
244         }
245
246         // Last updated as primary info.
247         #footer-info-lastmod {
248                 color: @pureBlack;
249                 font-size: 12pt;
250                 font-weight: bold;
251         }
252 }