MediaWiki:Print.css: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
/* --- Load custom print font --- */
/* ===========================
  Softwear — Print stylesheet
  A5 portrait, minimal margins
  =========================== */
 
/* --- 1) Font face (print-safe) --- */
@font-face {
@font-face {
   font-family: 'HALColant-TextRegular';
   font-family: 'HALColant-TextRegular';
Line 9: Line 14:
}
}


/* --- 2) Browser print color fidelity --- */
* { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
* { -webkit-print-color-adjust: exact; print-color-adjust: exact; }


/* Global print baseline */
/* --- 3) Base print visibility & typography --- */
.print-only { display: block !important; }
.print-only { display: block !important; } /* ensure print layout is visible */


/* Use the font everywhere in print */
html, body {
html, body {
   margin: 0;
   margin: 0;
Line 22: Line 27:
}
}


/* A5 page setup */
/* Use your preferred ink color */
@page {  
body { color: #292828 !important; }
    size: A5 portrait;
    margin: 2.5mm;
}  /* minimal outside margin for Chrome defaults */
.entry-wrapper.print-a5 { padding: 2.5mm; }   /* inner breathing room */


html, body { margin: 0; padding: 0;}
/* --- 4) Page size and margins --- */
@page {
  size: A5 portrait;
  margin: 2.5mm;           /* outer paper margin */
}


/* Main wrapper for the printable entry */
/* Inner breathing room for the print block */
.entry-wrapper.print-a5 {
.entry-wrapper.print-a5 {
   width: 100%;
   width: 100%;
   box-sizing: border-box;
   box-sizing: border-box;
   /* remove forced page break to avoid a blank trailing page on single prints */
   padding: 2.5mm;          /* inner content padding */
  /* page-break-after: always; */
}
}


/* Avoid splitting key sections across pages */
/* --- 5) Titles & people --- */
#article-title,
.article-title {
.article-title-link,
  font-size: 22px;
.article-images,
  line-height: 24px;
.article-metadata,
  letter-spacing: 0.8px;
.article-description,
  text-align: center;
.article-reflection,
   color: #292828 !important;
.article-external-reference,
   margin: 0;
.article-quote {
   page-break-inside: avoid;
   break-inside: avoid;
}
}


/* Typography & spacing for the print layout */
.article-people {
body { font-family: HALColant-TextRegular!important; color: #292828!important;}
  font-size: 22px;
 
  line-height: 28px;
.article-title {
  letter-spacing: 0.8px;
    font-size: 22px;
  text-align: center;
    line-height: 24px;
  text-decoration: underline;
    letter-spacing: 0.8px;
  color: #292828 !important;
    text-align: center;
  margin: 0;
    color: #292828!important;
  padding-top: 15px;
    margin: 0;
}
.article-people {  
    font-size: 22px;
    line-height: 28px;
    letter-spacing: 0.8px;
    text-align: center;
    text-decoration: underline;
    color: #292828!important;
    margin: 0;
    padding-top: 15px;
}
}


.article-people a {  
.article-people a {
    text-decoration: underline;
  text-decoration: underline;
    color: #292828!important;
  color: #292828 !important;
}
}


/* --- 6) Hairline rule under entry number --- */
.article-entry-number {
.article-entry-number {
    font-size: 16px;
  font-size: 16px;
    line-height: 23px;
  line-height: 23px;
    letter-spacing: 0;
  letter-spacing: 0;
    margin: 0;
  margin: 0;
    padding-bottom: 4px;
  padding-bottom: 4px;
    border-bottom: none;
  border-bottom: none;
 
  /* draw a crisp hairline using a background gradient */
    background-image: linear-gradient(#000, #000);
  background-image: linear-gradient(#000, #000);
    background-repeat: no-repeat;
  background-repeat: no-repeat;
    background-position: 0 100%;
  background-position: 0 100%;
    background-size: 100% 0.5px;  
  background-size: 100% 0.5px; /* ~hairline */
}
}


/* --- 7) Link row ([PDF⤴] [WEB⤴]) centered with hairline --- */
.link-pdf {
.link-pdf {
    text-align: center;
  text-align: center;
    color: #292828!important;
  color: #292828 !important;
    text-decoration: none;
  text-decoration: none;
  margin: 4px 0 0 0;
  padding: 0 0 0 0;
  border-bottom: none;
  background-image: linear-gradient(#000, #000);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.5px;
}


    margin-top: 4px;
.link-pdf a,
    margin-bottom: 0;
.link-pdf p {
    padding-bottom: 0;
  display: inline-block;
    border-bottom: none;
  text-decoration: none;
 
  color: #292828 !important;
    background-image: linear-gradient(#000, #000);
  margin: 0 !important;
    background-repeat: no-repeat;
  padding: 0 !important;
    background-position: 0 100%;
    background-size: 100% 0.5px; 
}
.link-pdf a, .link-pdf p {
    text-decoration: none;
    display: inline-block; 
    color: #292828!important;
    margin-top: 0!important;
}
}


.article-type {  
/* --- 8) Type line with hairline --- */
    font-size: 16px;
.article-type {
    line-height: 1;
  font-size: 16px;
    letter-spacing: 0;
  line-height: 1;
    margin: 0;     /* no external gap */
  letter-spacing: 0;
    padding-top: 7px;
  margin: 0;
    padding-bottom: 7px;
  padding: 7px 0;
    text-decoration: none;
  color: #292828 !important;
    color: #292828!important;
  border-bottom: none;
 
  background-image: linear-gradient(#000, #000);
    border-bottom: none;
  background-repeat: no-repeat;
    background-image: linear-gradient(#000, #000);
  background-position: 0 100%;
    background-repeat: no-repeat;
  background-size: 100% 0.5px;
    background-position: 0 100%;
    background-size: 100% 0.5px;  
}
}
.article-type a {
.article-type a {
    text-decoration: none;
  text-decoration: none;
    display: inline-block;
  display: inline-block;
    color: #292828!important;
  color: #292828 !important;
}
}


/* Reset margins & paddings inside metadata */
/* --- 9) Metadata grid (no margins/paddings; hairline under block) --- */
.article-metadata,
.article-metadata,
.article-metadata * {
.article-metadata * {
Line 145: Line 134:
   background: none;
   background: none;
}
}
.article-metadata {
.article-metadata {
    display: grid;
  display: grid;
    grid-template-columns: repeat(3, 1fr);
  grid-template-columns: repeat(3, 1fr);
    gap: 2mm; /* spacing between columns */
  gap: 2mm;
    padding-top: 11px;
  padding: 11px 0 7px 0;
    padding-bottom: 7px;
  line-height: 1 !important;
    line-height: 1 !important;
 
   
  border-bottom: none;
    border-bottom: none;
  background-image: linear-gradient(#000, #000);
    background-image: linear-gradient(#000, #000);
  background-repeat: no-repeat;
    background-repeat: no-repeat;
  background-position: 0 100%;
    background-position: 0 100%;
  background-size: 100% 0.5px;
    background-size: 100% 0.5px;  
}
}


.article-metadata-label {
.article-metadata-label {
    font-size: 13px;
  font-size: 13px;
    text-transform: uppercase;
  text-transform: uppercase;
    letter-spacing: 0.3px;
  letter-spacing: 0.3px;
}
}


.article-metadata-value {
.article-metadata-value {
    font-size: 15px;
  font-size: 15px;
    text-transform: capitalize;
  text-transform: capitalize;
}
}
.article-metadata-value a {
.article-metadata-value a {
    color: #292828!important;
  color: #292828 !important;
    text-decoration: none;
  text-decoration: none;
}
}


/* Remove any accidental gap before images */
.article-metadata + .article-images {
.article-metadata + .article-images {
   margin-top: 0 !important;   /* kill any gap above images */
   margin-top: 0 !important;
   padding-top: 0 !important;
   padding-top: 0 !important;
}
}


/* --- 10) Images & caption (no gaps; hairline under block) --- */
.article-images {
.article-images {
    margin: 0 !important;
  margin: 0 !important;
    padding: 0 !important;
  padding: 0 !important;
    page-break-inside: avoid;


    border-bottom: none;
  border-bottom: none;
    background-image: linear-gradient(#000, #000);
  background-image: linear-gradient(#000, #000);
    background-repeat: no-repeat;
  background-repeat: no-repeat;
    background-position: 0 100%;
  background-position: 0 100%;
    background-size: 100% 0.5px;
  background-size: 100% 0.5px;
}
}


.article-images .image-container {
.article-images .image-container {
    display: inline-flex;
  display: inline-flex;
    flex-direction: column;   /* stack image + caption */
  flex-direction: column; /* stack image then caption */
    align-items: flex-start;   /* push both to the right side of the page */
  align-items: flex-start; /* left-align image & caption */
    margin: 0 !important;
  margin: 0 !important;
    padding: 0 !important;
  padding: 0 !important;
}
 
.article-images .image-container img {
    display: block;
    height: 85mm;            /* fixed height */
    width: auto;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain;
    line-height: 0;  
}
}


.article-images .image-container img,
.image-container img {
.image-container img {
    margin: 0 !important;
  display: block;
    padding: 0 !important;
  max-height: 85mm;        /* cap instead of forcing height to reduce jumps */
  height: auto;
  width: auto;
  max-width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain;
  line-height: 0;
}
}


.caption-image1 {
.caption-image1 {
    margin-top: 0 !important;
  margin: 0 !important;
    padding-top: 0 !important;
  padding: 0 0 11px 0 !important; /* small breathing room under caption */
    padding-bottom: 11px;
  line-height: 1 !important;
    line-height: 1 !important;
  font-size: 9pt;
    font-size: 9pt;
  color: #555;
    text-align: left;         /* align text to the left edge of the image */
  text-align: left;
    width: 100%;             /* take the full width of the image container */
  width: 100%;
}
}


.vector-body p {
/* Kill user-agent margins in Vector paragraphs that sneak in */
    margin: 0 !important;
.vector-body p { margin: 0 !important; padding: 0 !important; }
    padding: 0 !important;
}


/* --- 11) Section labels & bodies --- */
.article-label-description,
.article-label-description,
.article-label-reflection,
.article-label-reflection,
Line 237: Line 222:
.article-label-quote,
.article-label-quote,
.article-label-modification-date {
.article-label-modification-date {
    text-transform: uppercase;
  text-transform: uppercase;
    margin-top: 11px !important;
  margin: 11px 0 0 0 !important;
    padding-top: 0 !important;
  padding: 0 !important;
    margin-bottom: 0 !important;
  text-indent: 35px;
    padding-bottom: 0 !important;
  line-height: 1;
    text-indent: 35px;
  font-size: 14px;
    line-height: 1;
  letter-spacing: 0.5px;
    font-size: 14px;
 
    letter-spacing: 0.5px;
  /* prevent a break RIGHT AFTER the label (no orphan label) */
  break-after: avoid;
  page-break-after: avoid;
}
}
.article-description,
.article-description,
.article-reflection,
.article-reflection,
Line 252: Line 240:
.article-quote,
.article-quote,
.article-modification-date {
.article-modification-date {
    text-indent: 35px;
  text-indent: 35px;
    line-height: 1.3;
  line-height: 1.3;
    font-size: 20px;
  font-size: 20px;
    letter-spacing: 0.8px;
  letter-spacing: 0.8px;
    margin-top: 0!important;
  margin-top: 0 !important;
    padding-top: 0 !important;
  padding: 0 0 11px 0 !important;
    padding-bottom: 11px!important;
 
  /* let long content flow normally; avoid hard blocking */
  page-break-inside: auto;
  break-inside: auto;
 
  /* draw hairline below each section body */
  border-bottom: none;
  background-image: linear-gradient(#000, #000);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.5px;
}


    border-bottom: none;
/* Don’t allow a break BEFORE the first block following each label */
    background-image: linear-gradient(#000, #000);
.article-label-description + .article-description,
    background-repeat: no-repeat;
.article-label-reflection + .article-reflection,
    background-position: 0 100%;
.article-label-external-reference + .article-external-reference,
    background-size: 100% 0.5px;  
.article-label-quote + .article-quote,
.article-label-modification-date + .article-modification-date {
  break-before: avoid;
  page-break-before: avoid;
}
}


/* Don’t append raw URLs in print */
/* Gentle control on widows/orphans globally */
a[href]:after { content: none !important; }
#article-content { orphans: 2; widows: 2; }


/* Wrap long links gracefully */
/* --- 12) Link handling for print --- */
a[href]:after { content: none !important; }  /* no raw URL echo */
.article-external-reference a {
.article-external-reference a {
   word-break: break-word;
   word-break: break-word;
   overflow-wrap: anywhere;
   overflow-wrap: anywhere;
}
}
/* Keep label + content together for each section */
.article-label-description { break-after: avoid; page-break-after: avoid; }
.article-label-description + .article-description {
  break-before: avoid; page-break-before: avoid;
}
/* Do the same for the other sections */
.article-label-reflection { break-after: avoid; page-break-after: avoid; }
.article-label-reflection + .article-reflection {
  break-before: avoid; page-break-before: avoid;
}
.article-label-external-reference { break-after: avoid; page-break-after: avoid; }
.article-label-external-reference + .article-external-reference {
  break-before: avoid; page-break-before: avoid;
}
.article-label-quote { break-after: avoid; page-break-after: avoid; }
.article-label-quote + .article-quote {
  break-before: avoid; page-break-before: avoid;
}
.article-label-modification-date { break-after: avoid; page-break-after: avoid; }
.article-label-modification-date + .article-modification-date {
  break-before: avoid; page-break-before: avoid;
}
/* Help the whole content area avoid awkward first-line breaks */
#article-content { orphans: 3; widows: 3; }

Navigation menu