4,456
edits
No edit summary |
No edit summary |
||
Line 1,370: | Line 1,370: | ||
// Remove “empty” optional sections so they don’t leave gaps in print. | // Remove “empty” optional sections so they don’t leave gaps in print. | ||
// Kill UA paragraph margins & set compact rhythm | // Kill UA paragraph margins & set compact rhythm (ES5-safe) | ||
var compactCSS = doc.createElement("style"); | var compactCSS = doc.createElement("style"); | ||
compactCSS. | compactCSS.type = "text/css"; | ||
@media print { | compactCSS.appendChild( | ||
doc.createTextNode( | |||
"@media print {" + | |||
" .print-only p { margin:0 !important; }" + | |||
" #article-content > * { margin-top:0 !important; margin-bottom:0 !important; }" + | |||
" #article-content > * + * { margin-top:2mm !important; }" + | |||
" .article-description p," + | |||
" .article-reflection p," + | |||
" .article-external-reference p," + | |||
" .article-quote { margin:0 0 1.2mm 0 !important; }" + | |||
" .article-description p:last-child," + | |||
" .article-reflection p:last-child," + | |||
" .article-external-reference p:last-child { margin-bottom:0 !important; }" + | |||
" .article-label-description," + | |||
" .article-label-reflection," + | |||
" .article-label-external-reference," + | |||
" .article-label-quote," + | |||
" .article-label-modification-date { margin:0 !important; }" + | |||
" .article-entry-number," + | |||
" .link-pdf," + | |||
" .article-type," + | |||
" .article-metadata," + | |||
" .article-images," + | |||
" .article-description," + | |||
" .article-reflection," + | |||
" .article-external-reference," + | |||
" .article-quote," + | |||
" .article-mod-line { margin:0 !important; }" + | |||
"}" | |||
) | |||
); | |||
doc.head.appendChild(compactCSS); | doc.head.appendChild(compactCSS); | ||