Difference between revisions of "MediaWiki:Print.css"
Jump to navigation
Jump to search
| Line 19: | Line 19: | ||
src: url("FedraSans-LightItalic.ttf"); | src: url("FedraSans-LightItalic.ttf"); | ||
font-style:italic; | font-style:italic; | ||
| + | } | ||
| + | |||
| + | /* this via https://en.wikipedia.org/wiki/MediaWiki:Print.css, 20 Aug 2024 */ | ||
| + | |||
| + | /* Do not print */ | ||
| + | .ns-0 .metadata, /* items in mainspace marked as metadata */ | ||
| + | .editlink, /* section edit links */ | ||
| + | .mw-collapsible-toggle, /* Show/hide toggles for collapsible items. */ | ||
| + | #mw-revision-nav, /* revision navigation on a permalink */ | ||
| + | /* Add formatting to make sure that "external references" from templates | ||
| + | like [[Template:Ref]] do not get URL expansion, not even when printed. | ||
| + | The anchor itself has class "external autonumber" and the url expansion | ||
| + | is inserted when printing using the ":after" pseudo-element of CSS. See | ||
| + | mediawiki.skinning/content.tables-print.less | ||
| + | */ | ||
| + | .nourlexpansion a.external.text::after, | ||
| + | .nourlexpansion a.external.autonumber::after { | ||
| + | display: none !important; | ||
| + | } | ||
| + | |||
| + | /* Uncollapse collapsible things | ||
| + | * See also [[phab:T152330]] | ||
| + | */ | ||
| + | .mw-parser-output .mw-collapsed, | ||
| + | .mw-parser-output .mw-collapsed .mw-collapsible-content, | ||
| + | .mw-parser-output .mw-collapsed > li, | ||
| + | .mw-parser-output .mw-collapsed tr { | ||
| + | /* fallback for browser versions that don't yet support revert | ||
| + | * on the support graph that's only grade C/X, so review this at a later date | ||
| + | */ | ||
| + | display: initial !important; | ||
| + | display: revert !important; /* revert works better for tables */ | ||
| + | } | ||
| + | |||
| + | /* On websites with siteSub visible, the margin on the firstHeading is not needed. */ | ||
| + | #firstHeading { | ||
| + | margin: 0; | ||
| + | } | ||
| + | |||
| + | /* We don't want very long URLs (that are added to the content in print) to widen the canvas */ | ||
| + | #content a.external.text::after, | ||
| + | #content a.external.autonumber::after { | ||
| + | word-wrap: break-word; | ||
| + | } | ||
| + | |||
| + | /* | ||
| + | - Basic infobox styling | ||
| + | - Remove background colors, they are hard to print | ||
| + | */ | ||
| + | .infobox { | ||
| + | border: solid 1px #aaa; | ||
| + | background-color: #fff; | ||
| + | border-spacing: 0; | ||
| + | border-collapse: collapse; | ||
| + | width: 180pt !important; /*T174957*/ | ||
| + | } | ||
| + | |||
| + | .infobox > * > tr > td, | ||
| + | .infobox > * > tr > th { | ||
| + | padding: 2px 5px; | ||
| + | border-bottom: 1px solid #EAECF0; | ||
| + | } | ||
| + | |||
| + | /* Reduce noise for print medium - labels may be links */ | ||
| + | .infobox a, | ||
| + | /* reset last border (set above) of infobox */ | ||
| + | .infobox > * > tr:last-child > th, | ||
| + | .infobox > * > tr:last-child > td { | ||
| + | border: 0; | ||
} | } | ||
Revision as of 12:06, 20 August 2024
/* CSS placed here will affect the print output */
body, #globalWrapper, #column-content, #content, #bodyContent, @media print {
font: fedra;
}
@font-face {
font-family: "fedra";
src: url("FedraSans-Light.ttf");
font-style:normal;
}
@font-face {
font-family: "fedra";
src: url("FedraSans-Medium.ttf");
font-weight:bold;
}
@font-face {
font-family: "fedra";
src: url("FedraSans-LightItalic.ttf");
font-style:italic;
}
/* this via https://en.wikipedia.org/wiki/MediaWiki:Print.css, 20 Aug 2024 */
/* Do not print */
.ns-0 .metadata, /* items in mainspace marked as metadata */
.editlink, /* section edit links */
.mw-collapsible-toggle, /* Show/hide toggles for collapsible items. */
#mw-revision-nav, /* revision navigation on a permalink */
/* Add formatting to make sure that "external references" from templates
like [[Template:Ref]] do not get URL expansion, not even when printed.
The anchor itself has class "external autonumber" and the url expansion
is inserted when printing using the ":after" pseudo-element of CSS. See
mediawiki.skinning/content.tables-print.less
*/
.nourlexpansion a.external.text::after,
.nourlexpansion a.external.autonumber::after {
display: none !important;
}
/* Uncollapse collapsible things
* See also [[phab:T152330]]
*/
.mw-parser-output .mw-collapsed,
.mw-parser-output .mw-collapsed .mw-collapsible-content,
.mw-parser-output .mw-collapsed > li,
.mw-parser-output .mw-collapsed tr {
/* fallback for browser versions that don't yet support revert
* on the support graph that's only grade C/X, so review this at a later date
*/
display: initial !important;
display: revert !important; /* revert works better for tables */
}
/* On websites with siteSub visible, the margin on the firstHeading is not needed. */
#firstHeading {
margin: 0;
}
/* We don't want very long URLs (that are added to the content in print) to widen the canvas */
#content a.external.text::after,
#content a.external.autonumber::after {
word-wrap: break-word;
}
/*
- Basic infobox styling
- Remove background colors, they are hard to print
*/
.infobox {
border: solid 1px #aaa;
background-color: #fff;
border-spacing: 0;
border-collapse: collapse;
width: 180pt !important; /*T174957*/
}
.infobox > * > tr > td,
.infobox > * > tr > th {
padding: 2px 5px;
border-bottom: 1px solid #EAECF0;
}
/* Reduce noise for print medium - labels may be links */
.infobox a,
/* reset last border (set above) of infobox */
.infobox > * > tr:last-child > th,
.infobox > * > tr:last-child > td {
border: 0;
}