2017-07-25 21:41:00 +00:00
|
|
|
@import 'variables.less';
|
2017-07-20 21:58:01 +00:00
|
|
|
@footerColor: #eee;
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-08-04 15:06:32 +00:00
|
|
|
// We have to render the wordmark image before the print dialog is invoked, otherwise the image
|
|
|
|
// won't render in the printed file. Use a little hack to render the image outside the viewport
|
|
|
|
// and bring it in the viewport in print view.
|
2017-11-02 18:04:58 +00:00
|
|
|
.firstHeading {
|
|
|
|
// We could also use a CSS background to display the logo.
|
|
|
|
// The problem is that the logo won't be printed unless the user prints the background too.
|
|
|
|
// Note. This specification does not fully define the interaction of :before and :after with
|
|
|
|
// replaced elements (such as IMG in HTML). This will be defined in more detail in a future
|
|
|
|
// specification. See https://www.w3.org/TR/CSS2/generate.html#before-after-content
|
|
|
|
& when( @printLogo = 1 ) {
|
|
|
|
&:before {
|
|
|
|
content: @printLogoUrl;
|
|
|
|
display: block;
|
|
|
|
height: ~'@{printLogoHeight}px';
|
|
|
|
left: -9999px;
|
|
|
|
line-height: 0; // line-height is needed for correctly displaying the size of the content box.
|
|
|
|
margin-bottom: 20px;
|
|
|
|
position: absolute;
|
|
|
|
width: ~'@{printLogoWidth}px';
|
2017-08-04 15:06:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-18 23:19:50 +00:00
|
|
|
@media print {
|
|
|
|
|
2017-07-25 21:41:00 +00:00
|
|
|
/* These styles retain the existing typography in screen.less
|
|
|
|
In future (when deploying these styles) we may want to refactor skins.vector.styles
|
|
|
|
to apply certain styles in print as well as screen mode. */
|
|
|
|
#toc,
|
2017-11-02 18:04:58 +00:00
|
|
|
body {
|
2017-07-24 23:46:46 +00:00
|
|
|
padding: 10px;
|
2017-07-25 21:41:00 +00:00
|
|
|
font-family: @font-family-serif;
|
|
|
|
}
|
|
|
|
|
|
|
|
.printfooter,
|
|
|
|
#footer,
|
|
|
|
// Tables, thumbs and lists are sans-serif in print mode (unlike screen mode) because these will render
|
|
|
|
// more legibly on print media in a smaller font sizes
|
|
|
|
.thumb,
|
|
|
|
table,
|
|
|
|
ol,
|
|
|
|
dl,
|
|
|
|
ul,
|
|
|
|
h3,
|
|
|
|
h4,
|
|
|
|
h5,
|
|
|
|
h6 {
|
|
|
|
font-family: @font-family-sans-serif;
|
2017-07-24 23:46:46 +00:00
|
|
|
}
|
|
|
|
|
2018-01-16 16:00:06 +00:00
|
|
|
// Images, such as formulas, render best in serif. Math fallback images, for example, have an
|
|
|
|
// inline style attribute setting their dimensions in ex (x-height) units, which is relative the
|
|
|
|
// font size:
|
|
|
|
// <img
|
|
|
|
// src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d03b01348b751e6f4eaff085b3effa9542e2935d"
|
|
|
|
// class="mwe-math-fallback-image-inline"
|
|
|
|
// aria-hidden="true"
|
|
|
|
// style="vertical-align: -2.171ex; width:11.418ex; height:5.676ex;"
|
|
|
|
// alt="r_{s}={\frac {2GM}{c^{2}}}">
|
2018-01-11 22:25:01 +00:00
|
|
|
img {
|
|
|
|
font-family: @font-family-serif;
|
|
|
|
}
|
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
// Normalize Blue links in the article
|
|
|
|
a {
|
|
|
|
border-bottom: 1px solid #aaa;
|
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
.firstHeading {
|
|
|
|
font-size: 25pt;
|
|
|
|
line-height: 28pt;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
padding-bottom: 5px;
|
Add print logo
Logo cannot be displayed as a background image because it won't be
visible in print unless the user prints backgrounds too.
A sample configuration looks like this:
$wgVectorPrintLogo = [
'url' => 'https://en.wikipedia.org/static/images/mobile/copyright/wikipedia-wordmark-en.svg',
'width' => 174,
'height' => 27
];
The solution presented in the patch has a downside of not being able
to scale images down if their dimensions are bigger than the
dimensions specified in the config variable. For example, if we want
to go with an SVG image, then IE8 won't be able to render it.
Alternatively, if we want to go with a PNG image, its dimensions need
to match the exact dimensoins in the config variable, otherwise the
image will show up larger or smaller depending on its dimensions.
A more complicated approach of scaling images using `transform: scale`
hasn't been used because we wanted to keep the configuration simple
while supporting the majority of our users. With the current change,
we can reuse the existing configuration options from Minerva, for
exmaple. It would look something like this:
$wgVectorPrintLogo = [
'url' => $wgMFCustomLogos['copyright'],
'width' => $wgMFCustomLogos['copyright-width'],
'height' => $wgMFCustomLogos['copyright-height']
];
Bug: T169826
Change-Id: If8f9f8d95fd3c955ece37d6c8ab6995596189667
2017-07-19 19:27:55 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
// Bring back the wordmark to the viewport (see above how it's rendered outside the viewport).
|
|
|
|
& when( @printLogo = 1 ) {
|
|
|
|
&:before {
|
|
|
|
left: auto;
|
|
|
|
position: relative;
|
Add print logo
Logo cannot be displayed as a background image because it won't be
visible in print unless the user prints backgrounds too.
A sample configuration looks like this:
$wgVectorPrintLogo = [
'url' => 'https://en.wikipedia.org/static/images/mobile/copyright/wikipedia-wordmark-en.svg',
'width' => 174,
'height' => 27
];
The solution presented in the patch has a downside of not being able
to scale images down if their dimensions are bigger than the
dimensions specified in the config variable. For example, if we want
to go with an SVG image, then IE8 won't be able to render it.
Alternatively, if we want to go with a PNG image, its dimensions need
to match the exact dimensoins in the config variable, otherwise the
image will show up larger or smaller depending on its dimensions.
A more complicated approach of scaling images using `transform: scale`
hasn't been used because we wanted to keep the configuration simple
while supporting the majority of our users. With the current change,
we can reuse the existing configuration options from Minerva, for
exmaple. It would look something like this:
$wgVectorPrintLogo = [
'url' => $wgMFCustomLogos['copyright'],
'width' => $wgMFCustomLogos['copyright-width'],
'height' => $wgMFCustomLogos['copyright-height']
];
Bug: T169826
Change-Id: If8f9f8d95fd3c955ece37d6c8ab6995596189667
2017-07-19 19:27:55 +00:00
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
}
|
2017-11-02 18:04:58 +00:00
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
// Headings
|
|
|
|
.firstHeading,
|
|
|
|
h2 {
|
|
|
|
// To avoid the bottom border of section headings with floated elements
|
|
|
|
overflow: hidden;
|
|
|
|
border-bottom: 2px solid @pureBlack;
|
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
h3,
|
|
|
|
h4,
|
|
|
|
h5,
|
|
|
|
h6 {
|
|
|
|
margin: 30px 0 0;
|
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
h2,
|
|
|
|
h3,
|
|
|
|
h4,
|
|
|
|
h5,
|
|
|
|
h6 {
|
|
|
|
padding: 0;
|
|
|
|
position: relative;
|
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
h2 {
|
|
|
|
font-size: 18pt;
|
|
|
|
line-height: 24pt;
|
|
|
|
margin-bottom: 0.25em;
|
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
h3 {
|
|
|
|
font-size: 13pt;
|
|
|
|
line-height: 20pt;
|
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
h4,
|
|
|
|
h5,
|
|
|
|
h6 {
|
|
|
|
font-size: 10pt;
|
|
|
|
line-height: 15pt;
|
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
p {
|
|
|
|
font-size: 10pt;
|
|
|
|
line-height: 16pt;
|
|
|
|
margin-top: 5px;
|
|
|
|
text-align: justify;
|
|
|
|
|
|
|
|
// T175008
|
|
|
|
// When a paragraph is surrounded by floating elements from both
|
|
|
|
// sides, we want to make sure that there is at least some space
|
|
|
|
// before showing the text. Otherwise, small lengths of text may show
|
|
|
|
// between the surrounding elements, making the reading experience less
|
|
|
|
// enjoyable. If there is not enough space the following code will push
|
|
|
|
// the paragraph contents until after the floating element(s).
|
|
|
|
@paragraphMinWidth: 120pt;
|
|
|
|
&:before {
|
|
|
|
content: '';
|
|
|
|
display: block;
|
|
|
|
overflow: hidden;
|
|
|
|
width: @paragraphMinWidth;
|
2017-07-18 23:19:50 +00:00
|
|
|
}
|
2017-11-02 18:04:58 +00:00
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
blockquote {
|
|
|
|
border-left: 2px solid @pureBlack;
|
|
|
|
padding-left: 20px;
|
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
ol,
|
|
|
|
ul {
|
|
|
|
margin: 10px 0 0 1.6em;
|
|
|
|
padding: 0;
|
2017-07-18 23:19:50 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
li {
|
|
|
|
padding: 2px 0;
|
|
|
|
font-size: 10pt;
|
2017-12-15 11:53:09 +00:00
|
|
|
|
|
|
|
// T178667: Inline lists in new print styles should not
|
|
|
|
// have a smaller font size than surrounding content
|
|
|
|
table & {
|
|
|
|
font-size: inherit;
|
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
}
|
2017-11-02 18:04:58 +00:00
|
|
|
}
|
2017-07-20 19:23:52 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
// Using #toc rather than .toc to override default print style
|
|
|
|
#toc {
|
|
|
|
page-break-before: avoid;
|
|
|
|
page-break-after: avoid;
|
|
|
|
background: none;
|
|
|
|
border: 0;
|
|
|
|
display: table;
|
2017-07-20 19:23:52 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
a {
|
|
|
|
border: 0;
|
|
|
|
font-weight: normal;
|
|
|
|
}
|
2017-07-20 19:23:52 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
> ul {
|
2017-07-20 19:23:52 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
> li {
|
|
|
|
margin-bottom: 4px;
|
|
|
|
font-weight: bold;
|
2017-07-20 19:23:52 +00:00
|
|
|
}
|
2017-11-02 18:04:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ul {
|
|
|
|
margin: 0;
|
|
|
|
list-style: none;
|
2017-07-20 19:23:52 +00:00
|
|
|
|
|
|
|
ul {
|
2017-11-02 18:04:58 +00:00
|
|
|
padding-left: 30px;
|
2017-07-20 19:23:52 +00:00
|
|
|
}
|
2017-11-02 18:04:58 +00:00
|
|
|
}
|
2017-07-20 19:23:52 +00:00
|
|
|
|
2017-11-02 18:04:58 +00:00
|
|
|
li.toclevel-1 {
|
|
|
|
> a {
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 10pt;
|
2017-07-20 19:23:52 +00:00
|
|
|
}
|
|
|
|
}
|
2017-11-02 18:04:58 +00:00
|
|
|
|
|
|
|
.tocnumber {
|
2017-12-10 20:10:06 +00:00
|
|
|
display: none;
|
2017-11-02 18:04:58 +00:00
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
}
|
2017-07-20 21:58:01 +00:00
|
|
|
|
|
|
|
.printfooter {
|
|
|
|
margin-top: 10px;
|
|
|
|
border-top: 3px solid @pureBlack;
|
|
|
|
padding-top: 10px;
|
|
|
|
font-size: 10pt;
|
2017-10-20 20:21:58 +00:00
|
|
|
clear: both;
|
2017-07-20 21:58:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#footer {
|
|
|
|
margin-top: 12px;
|
|
|
|
border-top: 1px solid @footerColor;
|
|
|
|
padding-top: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#footer-info {
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
li {
|
2017-08-10 17:26:02 +00:00
|
|
|
color: #999;
|
2017-07-20 21:58:01 +00:00
|
|
|
list-style: none;
|
|
|
|
display: block;
|
|
|
|
padding-bottom: 10px;
|
|
|
|
font-size: 10pt;
|
|
|
|
|
|
|
|
a {
|
|
|
|
// override default black print style.
|
2017-08-10 17:26:02 +00:00
|
|
|
color: #999 !important; /* stylelint-disable-line declaration-no-important */
|
2017-07-20 21:58:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Last updated as primary info.
|
|
|
|
#footer-info-lastmod {
|
|
|
|
color: @pureBlack;
|
|
|
|
font-size: 12pt;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2017-07-18 23:19:50 +00:00
|
|
|
}
|