Difference between revisions of "MediaWiki:Print.css"

From 1MinuteSite Wiki
Line 1: Line 1:
<p>
+
/* <syntaxhighlight lang="css"> */
<p>/* &lt;syntaxhighlight lang="css"&gt; */</p>
+
 
<p>&nbsp;</p>
+
/* Do not print:
<p>/* Do not print:</p>
+
  1: When in mainspace: Article message boxes,
<p>&nbsp;&nbsp; 1: When in mainspace: Article message boxes,</p>
+
      navboxes, sister project boxes, disambig links,
<p>&nbsp;&nbsp; &nbsp; &nbsp;navboxes, sister project boxes, disambig links,</p>
+
      and items marked as metadata.
<p>&nbsp;&nbsp; &nbsp; &nbsp;and items marked as metadata.</p>
+
  2: Privacy, about, disclaimer, redirect and section edit links.
<p>&nbsp;&nbsp; 2: Privacy, about, disclaimer, redirect and section edit links.</p>
+
  3: Show/hide toggles for collapsible items.
<p>&nbsp;&nbsp; 3: Show/hide toggles for collapsible items.</p>
+
  4: Items marked as noprint.
<p>&nbsp;&nbsp; 4: Items marked as noprint.</p>
+
*/
<p>*/</p>
+
.ns-0 .ambox,  
<p>.ns-0 .ambox,&nbsp;</p>
+
.ns-0 .navbox,  
<p>.ns-0 .navbox,&nbsp;</p>
+
.ns-0 .infobox.sisterproject,  
<p>.ns-0 .infobox.sisterproject,&nbsp;</p>
+
.ns-0 .dablink,  
<p>.ns-0 .dablink,&nbsp;</p>
+
.ns-0 .metadata,
<p>.ns-0 .metadata,</p>
+
#filetoc,  
<p>#filetoc,&nbsp;</p>
+
#footer-places,
<p>#footer-places,</p>
+
.editlink,
<p>.editlink,</p>
+
span.collapseButton, a.NavToggle,
<p>span.collapseButton, a.NavToggle,</p>
+
.noprint {
<p>.noprint {</p>
+
    display: none;
<p>&nbsp;&nbsp; &nbsp;display: none;</p>
+
}
<p>}</p>
+
 
<p>&nbsp;</p>
+
/* Add formatting to make sure that "external references" from templates
<p>/* Add formatting to make sure that "external references" from templates</p>
+
  like [[Template:Ref]] do not get URL expansion, not even when printed.
<p>&nbsp;&nbsp; like [[Template:Ref]] do not get URL expansion, not even when printed.</p>
+
  The anchor itself has class "external autonumber" and the url expansion
<p>&nbsp;&nbsp; The anchor itself has class "external autonumber" and the url expansion</p>
+
  is inserted when printing (see the common printing style sheet at
<p>&nbsp;&nbsp; is inserted when printing (see the common printing style sheet at</p>
+
  http://en.wikipedia.org/skins-1.5/common/commonPrint.css) using the
<p>&nbsp;&nbsp; http://en.wikipedia.org/skins-1.5/common/commonPrint.css) using the</p>
+
  ":after" pseudo-element of CSS. Also hide in <cite> elements.
<p>&nbsp;&nbsp; ":after" pseudo-element of CSS. Also hide in &lt;cite&gt; elements.</p>
+
*/
<p>*/</p>
+
#content cite a.external.text:after,
<p>#content cite a.external.text:after,</p>
+
.nourlexpansion a.external.text:after,
<p>.nourlexpansion a.external.text:after,</p>
+
.nourlexpansion a.external.autonumber:after {
<p>.nourlexpansion a.external.autonumber:after {</p>
+
    display: none !important;
<p>&nbsp;&nbsp; &nbsp;display: none !important;</p>
+
}
<p>}</p>
+
 
<p>&nbsp;</p>
+
/* Uncollapse collapsible tables/divs.
<p>/* Uncollapse collapsible tables/divs.</p>
+
  The proper way to do this for tables is to use display:table-row,
<p>&nbsp;&nbsp; The proper way to do this for tables is to use display:table-row,</p>
+
  but this is not supported by all browsers, so use display:block as fallback.
<p>&nbsp;&nbsp; but this is not supported by all browsers, so use display:block as fallback.</p>
+
*/
<p>*/</p>
+
table.collapsible tr, div.NavPic, div.NavContent {
<p>table.collapsible tr, div.NavPic, div.NavContent {</p>
+
    display: block !important;
<p>&nbsp;&nbsp; &nbsp;display: block !important;</p>
+
}
<p>}</p>
+
table.collapsible tr {
<p>table.collapsible tr {</p>
+
    display: table-row !important;
<p>&nbsp;&nbsp; &nbsp;display: table-row !important;</p>
+
}
<p>}</p>
+
 
<p>&nbsp;</p>
+
/* Hiding some items when printing with Simple skin */
<p>/* Hiding some items when printing with Simple skin */</p>
+
.skin-simple div#column-one,
<p>.skin-simple div#column-one,</p>
+
.skin-simple div#f-poweredbyico,
<p>.skin-simple div#f-poweredbyico,</p>
+
.skin-simple div#f-copyrightico,
<p>.skin-simple div#f-copyrightico,</p>
+
.skin-simple .editsection {  
<p>.skin-simple .editsection {&nbsp;</p>
+
    display: none;  
<p>&nbsp;&nbsp; &nbsp;display: none;&nbsp;</p>
+
}
<p>}</p>
+
 
<p>&nbsp;</p>
+
/* wikitable class for skinning normal tables */
<p>/* wikitable class for skinning normal tables */</p>
+
table.wikitable {
<p>table.wikitable {</p>
+
    margin: 1em 1em 1em 0;
<p>&nbsp;&nbsp; &nbsp;margin: 1em 1em 1em 0;</p>
+
    border: 1px #aaa solid;
<p>&nbsp;&nbsp; &nbsp;border: 1px #aaa solid;</p>
+
    border-collapse: collapse;
<p>&nbsp;&nbsp; &nbsp;border-collapse: collapse;</p>
+
}
<p>}</p>
+
.wikitable th, .wikitable td {
<p>.wikitable th, .wikitable td {</p>
+
    border: 1px #aaa solid;
<p>&nbsp;&nbsp; &nbsp;border: 1px #aaa solid;</p>
+
    padding: 0.2em;
<p>&nbsp;&nbsp; &nbsp;padding: 0.2em;</p>
+
}
<p>}</p>
+
.wikitable th {
<p>.wikitable th {</p>
+
    text-align: center;
<p>&nbsp;&nbsp; &nbsp;text-align: center;</p>
+
    background: #F2F2F2;
<p>&nbsp;&nbsp; &nbsp;background: #F2F2F2;</p>
+
    font-weight: bold;
<p>&nbsp;&nbsp; &nbsp;font-weight: bold;</p>
+
}
<p>}</p>
+
.wikitable caption {
<p>.wikitable caption {</p>
+
    font-weight: bold;
<p>&nbsp;&nbsp; &nbsp;font-weight: bold;</p>
+
}
<p>}</p>
+
 
<p>&nbsp;</p>
+
/* On websites with siteSub visible, the margin on the firstHeading is not needed. */
<p>/* On websites with siteSub visible, the margin on the firstHeading is not needed. */</p>
+
#firstHeading {
<p>#firstHeading {</p>
+
    margin: 0px;
<p>&nbsp;&nbsp; &nbsp;margin: 0px;</p>
+
}
<p>}</p>
+
 
<p>&nbsp;</p>
+
/* Remove once r76522 is live */
<p>/* Remove once r76522 is live */</p>
+
.wikitable, .thumb, img {
<p>.wikitable, .thumb, img {</p>
+
page-break-inside: avoid;
<p><span style="white-space: pre;"> </span>page-break-inside: avoid;</p>
+
}
<p>}</p>
+
h2, h3, h4, h5, h6, h7 {
<p>h2, h3, h4, h5, h6, h7 {</p>
+
page-break-after: avoid;
<p><span style="white-space: pre;"> </span>page-break-after: avoid;</p>
+
}
<p>}</p>
+
p {
<p>p {</p>
+
widows: 3;
<p><span style="white-space: pre;"> </span>widows: 3;</p>
+
orphans: 3;
<p><span style="white-space: pre;"> </span>orphans: 3;</p>
+
}
<p>}</p>
+
 
<p>&nbsp;</p>
+
/* </syntaxhighlight> */
<p>/* &lt;/syntaxhighlight&gt; */</p>
 
</p>
 

Revision as of 14:55, 10 February 2011

/* <syntaxhighlight lang="css"> */

/* Do not print:
   1: When in mainspace: Article message boxes,
      navboxes, sister project boxes, disambig links,
      and items marked as metadata.
   2: Privacy, about, disclaimer, redirect and section edit links.
   3: Show/hide toggles for collapsible items.
   4: Items marked as noprint.
*/
.ns-0 .ambox, 
.ns-0 .navbox, 
.ns-0 .infobox.sisterproject, 
.ns-0 .dablink, 
.ns-0 .metadata,
#filetoc, 
#footer-places,
.editlink,
span.collapseButton, a.NavToggle,
.noprint {
    display: none;
}

/* 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 (see the common printing style sheet at
   http://en.wikipedia.org/skins-1.5/common/commonPrint.css) using the
   ":after" pseudo-element of CSS. Also hide in <cite> elements.
*/
#content cite a.external.text:after,
.nourlexpansion a.external.text:after,
.nourlexpansion a.external.autonumber:after {
    display: none !important;
}

/* Uncollapse collapsible tables/divs.
   The proper way to do this for tables is to use display:table-row,
   but this is not supported by all browsers, so use display:block as fallback.
*/
table.collapsible tr, div.NavPic, div.NavContent {
    display: block !important;
}
table.collapsible tr {
    display: table-row !important;
}

/* Hiding some items when printing with Simple skin */
.skin-simple div#column-one,
.skin-simple div#f-poweredbyico,
.skin-simple div#f-copyrightico,
.skin-simple .editsection { 
    display: none; 
}

/* wikitable class for skinning normal tables */
table.wikitable {
    margin: 1em 1em 1em 0;
    border: 1px #aaa solid;
    border-collapse: collapse;
}
.wikitable th, .wikitable td {
    border: 1px #aaa solid;
    padding: 0.2em;
}
.wikitable th {
    text-align: center;
    background: #F2F2F2;
    font-weight: bold;
}
.wikitable caption {
    font-weight: bold;
}

/* On websites with siteSub visible, the margin on the firstHeading is not needed. */
#firstHeading {
    margin: 0px;
}

/* Remove once r76522 is live */
.wikitable, .thumb, img {
	page-break-inside: avoid;
}
h2, h3, h4, h5, h6, h7 {
	page-break-after: avoid;
}
p {
	widows: 3;
	orphans: 3;
}

/* </syntaxhighlight> */