Jump to content

MediaWiki:Print.css: Difference between revisions

From greyhawk
mNo edit summary
mNo edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* CSS placed here will affect the print output */
/* MediaWiki:Print.css */


/* --- GENERAL PRINT SETTINGS & REMOVALS --- */
@media print {
@media print {
     /* Remove non-essential elements */
     /* --- General Print Cleanup --- */
     .firstHeading { margin-top: 0; padding-top: 0; }
     /* Remove navigation, sidebars, and other elements not needed for print */
    #toc { display: none; }
     #mw-navigation, #mw-panel, #p-cactions, #p-personal, #p-views,
    #siteSub { display: none; }
    #p-navigation, #p-search, #siteSub, #footer, #catlinks,
    .printfooter { display: none; }
     .noprint, .editsection, .mw-indicators, .printfooter,
    #catlinks, .catlinks { display: none; }
    #privacy, #about, #disclaimer, #toc {
     #footer { display: none; }
    #privacy, #about, #disclaimer {display:none;}
    #p-cactions, #p-personal, #p-views, #p-navigation, #p-search,
     .noprint, .editsection, .mw-indicators { /* Hide common navigation/interface elements */
         display: none !important;
         display: none !important;
     }
     }


     /* Force background colors/images to print (use with caution, ink intensive!) */
     /* Adjust page margins for better print layout */
    /* If you absolutely want backgrounds, uncomment this, but it's not generally recommended for print. */
    /*
     body {
     body {
         -webkit-print-color-adjust: exact; /* Chrome, Safari */
         margin: 1.5cm; /* Roughly 0.6 inches on all sides */
         color-adjust: exact; /* Other browsers */
        font-family: sans-serif; /* Use a common sans-serif font for readability if 'Century Schoolbook' isn't available */
        font-size: 8.5pt !important; /* FURTHER REDUCED: Base font size for print */
         line-height: 1.3 !important; /* Slightly tighter line height for compactness */
     }
     }
    */


     /* --- FONT FIXES --- */
     /* --- Header Sizing --- */
     /* Set default font for the whole site */
     /* Main page title (h1) */
     body {
     h1#firstHeading, #content h1 {
        font-family: "Century Schoolbook", serif; /* Add a generic fallback */
         font-size: 17pt !important; /* REDUCED from 18pt */
         font-size: 1.5em; /* Ensure this size is applied */
         margin-top: 1em !important;
         font-weight: normal;
         margin-bottom: 0.7em !important;
        /* Remove the problematic 'inherit !important' if it's causing issues */
         line-height: 1.2em !important;
         /* font-size: inherit !important; -- REMOVE THIS LINE IF IT'S IN YOUR ACTUAL CSS */
         text-align: center;
    }
 
    h1 {
        font-family: "CasablancaAntique", "Century Schoolbook", serif;
         font-size: 3em;
        /* Remove the problematic 'inherit !important' if it's causing issues */
         /* font-size: inherit !important; -- REMOVE THIS LINE IF IT'S IN YOUR ACTUAL CSS */
     }
     }


    /* Section headings from `== Heading ==` (render as h2) */
     h2 {
     h2 {
         font-family: "CasablancaAntique", "Century Schoolbook", serif;
         font-size: 13pt !important; /* REDUCED from 14pt */
         font-size: 2.5em;
         margin-top: 1.2em !important;
         font-variant: small-caps;
         margin-bottom: 0.6em !important;
         text-decoration: underline;
         line-height: 1.2em !important;
        /* Remove the problematic 'inherit !important' if it's causing issues */
         text-align: center;
         /* font-size: inherit !important; -- REMOVE THIS LINE IF IT'S IN YOUR ACTUAL CSS */
        page-break-after: avoid;
     }
     }


    /* Subsection headings from `=== Subheading ===` (render as h3) */
     h3 {
     h3 {
         font-family: "Century Schoolbook", serif;
         font-size: 11pt !important; /* REDUCED from 12pt */
         font-size: 2em;
         margin-top: 1em !important;
         font-variant: small-caps;
         margin-bottom: 0.5em !important;
        /* Remove the problematic 'inherit !important' if it's causing issues */
         line-height: 1.2em !important;
         /* font-size: inherit !important; -- REMOVE THIS LINE IF IT'S IN YOUR ACTUAL CSS */
        page-break-after: avoid;
     }
     }


     h4 {
     /* Smaller headings (h4, h5, h6) */
         font-family: "Century Schoolbook", serif;
    h4, h5, h6 {
         font-size: 2em;
         font-size: 9pt !important; /* REDUCED from 10pt */
         font-variant: small-caps;
         margin-top: 0.8em !important;
        /* Remove the problematic 'inherit !important' if it's causing issues */
         margin-bottom: 0.4em !important;
         /* font-size: inherit !important; -- REMOVE THIS LINE IF IT'S IN YOUR ACTUAL CSS */
         line-height: 1.2em !important;
        page-break-after: avoid;
     }
     }


     /* --- IMAGE / THUMBNAIL PRINT STYLES --- */
     /* Specific styling for the 'The Setting and Scene' block h2, if needed */
    /* Ensure thumbnails behave like thumbnails in print */
     .mw-parser-output div[style*="text-align: center;"] h2 {
     .thumb {
         font-size: 15pt !important; /* REDUCED from 16pt */
        float: left; /* Allow text to wrap around the image */
        margin: 0.5em 1em 0.5em 0; /* Adjust spacing around the thumbnail: top right bottom left */
        border: 1px solid #ccc; /* Add a subtle border like online */
        padding: 4px; /* Add some padding inside the border */
        background-color: #f9f9f9; /* Light background */
        box-sizing: border-box; /* Include padding and border in element's total width/height */
        max-width: 200px; /* **ADJUST THIS**: Set a reasonable maximum width for the thumbnail container */
         page-break-inside: avoid; /* Prevent thumbnails from breaking across pages */
     }
     }


     .thumbinner {
     /* --- Body Text & List Item Styling --- */
         padding: 3px !important; /* Adjust inner padding if needed */
    /* Ensure all common text blocks and list items use the smaller base font size */
         border: none !important; /* Remove inner border if default has one */
    p, ul, ol, dl, pre, blockquote, table, li, td, th {
         background-color: transparent !important;
        font-size: 8.5pt !important; /* MATCHES new body font size */
         line-height: 1.4 !important; /* Keep readability */
         margin-top: 0.3em !important; /* Tighter spacing between elements */
         margin-bottom: 0.3em !important; /* Tighter spacing between elements */
     }
     }
 
   
     .thumbimage {
     /* Ensure content inside definition lists also gets proper spacing */
        max-width: 100%; /* Important: Constrain image to its container */
    dd {
        height: auto; /* Maintain aspect ratio */
         margin-left: 1.5em !important; /* Standard indent for definition descriptions */
         display: block; /* Ensures it behaves nicely within the div */
         font-size: 8.5pt !important; /* MATCHES new body font size */
         border: 1px solid #ccc; /* Add border directly to image */
     }
     }
 
     dt {
     .thumbcaption {
         font-weight: bold !important;
         font-size: 0.9em; /* Smaller font for caption */
         font-size: 8.5pt !important; /* MATCHES new body font size */
         line-height: 1.3em;
        padding: 3px 0; /* Padding for the caption */
        text-align: left; /* Align caption text */
        overflow: hidden; /* Prevent long captions from breaking layout */
     }
     }


     /* Styles for images that are not thumbnails but should be smaller */
     /* --- Image & Thumbnail Styling --- */
     /* This targets any img tag not inside a .thumb, useful for other embedded images */
     img {
    img:not(.thumbimage) {
         max-width: 95% !important; /* Ensure images don't stretch too wide */
         max-width: 80%; /* Limit width of other images */
         height: auto !important;
         height: auto;
         display: block;
         display: block;
         margin: 1em auto; /* Center them if they are block */
         margin: 0.8em auto !important; /* Center images with some vertical spacing */
     }
     }


     /* --- TEMPLATE-SPECIFIC LAYOUT ADJUSTMENTS (FOR SESSION PREP) --- */
     .thumb {
    /* This assumes the Session Prep template renders content in a specific HTML structure.
        float: none !important; /* Remove float for simpler print layout */
      You might need to inspect the live page HTML to get the exact classes/IDs. */
        margin: 0.8em auto !important; /* Center the thumbnail container */
        max-width: 200px !important; /* Adjust this to control thumbnail width */
        border: 1px solid #ccc;
        padding: 3px !important; /* Slightly less padding */
        background-color: #f9f9f9;
        box-sizing: border-box;
        page-break-inside: avoid;
    }


    /* Example: If Session Prep uses divs or tables for layout */
     .thumbinner {
     .session-prep-container { /* Replace with actual class/ID from template HTML */
        padding: 2px !important; /* Slightly less inner padding */
         page-break-after: always; /* If you want each session prep to start on a new page */
         border: none !important;
        background-color: transparent !important;
     }
     }


     /* If it uses definition lists (dl, dt, dd) for key-value pairs */
     .thumbimage {
    dl.session-prep-data { /* Adjust class name */
         max-width: 100% !important;
         margin-bottom: 1em;
        height: auto !important;
        display: block;
        border: none !important;
     }
     }
     dl.session-prep-data dt {
 
         font-weight: bold;
     .thumbcaption {
         float: left; /* Try to make keys float left */
         font-size: 7.5pt !important; /* REDUCED from 8pt */
         clear: left;
         line-height: 1.2em !important;
         margin-right: 0.5em;
         padding: 2px 0 !important;
         width: 120px; /* Adjust as needed for labels */
         text-align: left !important;
         overflow: hidden !important;
     }
     }
     dl.session-prep-data dd {
 
        margin-left: 130px; /* Align content with dt width */
     /* --- Column Layout Adjustments --- */
        margin-bottom: 0.5em;
    }
   
    /* Ensure content inside columns doesn't break poorly */
     .module, .div-col {
     .module, .div-col {
         column-count: 1 !important; /* Force single column layout for print if multi-columns cause issues */
         column-count: 1 !important; /* Force single column for print readability */
         column-width: auto !important;
         column-width: auto !important;
         column-rule: none !important; /* Remove column rule if it's there */
         column-rule: none !important;
     }
     }
   
    /* Avoid breaking within list items or paragraphs inside columns */
     .div-col li, .div-col dd, .div-col p {
     .div-col li, .div-col dd, .div-col p {
         break-inside: avoid-column; /* Old property, less effective */
         break-inside: avoid;
        break-inside: avoid; /* Modern property */
     }
     }
    /* Headings within template content might need adjusted margins for print */
    .session-prep-content h5, .session-prep-content h6 { /* Assuming template generates these */
        margin-top: 1em;
        margin-bottom: 0.5em;
        page-break-after: avoid; /* Keep heading with content */
    }
    /* Specific element for 'hooks' or 'key_events' */
    .mw-headline { /* Often used for section headings */
        page-break-after: avoid;
        page-break-before: avoid;
    }
    /* Ensure {{:Borin}} and other transcluded NPCs print cleanly */
    /* This will depend on their individual page's HTML structure */
    /* If they are just text, they'll print fine. If they have complex layouts,
      you might need print CSS on their individual pages too, or target their
      containers here. */
    .mw-parser-output .thumb { /* More specific selector for thumbnails within content */
        float: left;
        margin: 0.5em 1em 0.5em 0;
        max-width: 180px; /* Make NPC thumbnails slightly smaller perhaps */
    }
} /* End @media print */
/* --- NON-PRINT SPECIFIC STYLES (Keep as they were) --- */
/* Your original font definitions are outside the @media print block.
  This means they apply to both screen and print, unless overridden by @media print.
  The 'inherit !important' lines here are very likely the culprit for font issues.
  If you have them outside the @media print block, remove them. */
/* I'm commenting out the problematic 'inherit !important' and ensuring the size is set.
  If these lines exist outside your @media print block in the actual CSS,
  you should remove the 'font-size: inherit !important;' line. */
/*
body {
  /* Override any editor added inline styles that play with font-size */
  /* font-size: inherit !important; */
  font-family:  "Century Schoolbook";
  font-size: 1.5 em;
  font-weight: normal;
}
h1 {
  /* Override any editor added inline styles that play with font-size */
  /* font-size: inherit !important; */
  font-family: "CasablancaAntique", "Century Schoolbook";
  font-size:  3em;
}
*/
/* ... similar for h2, h3, h4 ... */
.module {
    column-count: 2; /* This will be overridden by the @media print rule above for print */
}
.div-col {
margin-top: 0.3em;
column-width: 40em; /* This will be overridden by the @media print rule above for print */
}
.div-col-rules {
column-rule: 1px solid #aaa; /* This will be overridden by the @media print rule above for print */
}
/* Reset top margin for lists in div col */
.div-col dl,
.div-col ol,
.div-col ul {
margin-top: 0;
}
/* Avoid elements breaking between columns
   See also Template:No col break */
.div-col li,
.div-col dd {
break-inside: avoid-column;
}
}

Latest revision as of 19:15, 19 June 2025

/* MediaWiki:Print.css */

@media print {
    /* --- General Print Cleanup --- */
    /* Remove navigation, sidebars, and other elements not needed for print */
    #mw-navigation, #mw-panel, #p-cactions, #p-personal, #p-views,
    #p-navigation, #p-search, #siteSub, #footer, #catlinks,
    .noprint, .editsection, .mw-indicators, .printfooter,
    #privacy, #about, #disclaimer, #toc {
        display: none !important;
    }

    /* Adjust page margins for better print layout */
    body {
        margin: 1.5cm; /* Roughly 0.6 inches on all sides */
        font-family: sans-serif; /* Use a common sans-serif font for readability if 'Century Schoolbook' isn't available */
        font-size: 8.5pt !important; /* FURTHER REDUCED: Base font size for print */
        line-height: 1.3 !important; /* Slightly tighter line height for compactness */
    }

    /* --- Header Sizing --- */
    /* Main page title (h1) */
    h1#firstHeading, #content h1 {
        font-size: 17pt !important; /* REDUCED from 18pt */
        margin-top: 1em !important;
        margin-bottom: 0.7em !important;
        line-height: 1.2em !important;
        text-align: center;
    }

    /* Section headings from `== Heading ==` (render as h2) */
    h2 {
        font-size: 13pt !important; /* REDUCED from 14pt */
        margin-top: 1.2em !important;
        margin-bottom: 0.6em !important;
        line-height: 1.2em !important;
        text-align: center;
        page-break-after: avoid;
    }

    /* Subsection headings from `=== Subheading ===` (render as h3) */
    h3 {
        font-size: 11pt !important; /* REDUCED from 12pt */
        margin-top: 1em !important;
        margin-bottom: 0.5em !important;
        line-height: 1.2em !important;
        page-break-after: avoid;
    }

    /* Smaller headings (h4, h5, h6) */
    h4, h5, h6 {
        font-size: 9pt !important; /* REDUCED from 10pt */
        margin-top: 0.8em !important;
        margin-bottom: 0.4em !important;
        line-height: 1.2em !important;
        page-break-after: avoid;
    }

    /* Specific styling for the 'The Setting and Scene' block h2, if needed */
    .mw-parser-output div[style*="text-align: center;"] h2 {
        font-size: 15pt !important; /* REDUCED from 16pt */
    }

    /* --- Body Text & List Item Styling --- */
    /* Ensure all common text blocks and list items use the smaller base font size */
    p, ul, ol, dl, pre, blockquote, table, li, td, th {
        font-size: 8.5pt !important; /* MATCHES new body font size */
        line-height: 1.4 !important; /* Keep readability */
        margin-top: 0.3em !important; /* Tighter spacing between elements */
        margin-bottom: 0.3em !important; /* Tighter spacing between elements */
    }
    
    /* Ensure content inside definition lists also gets proper spacing */
    dd {
        margin-left: 1.5em !important; /* Standard indent for definition descriptions */
        font-size: 8.5pt !important; /* MATCHES new body font size */
    }
    dt {
        font-weight: bold !important;
        font-size: 8.5pt !important; /* MATCHES new body font size */
    }

    /* --- Image & Thumbnail Styling --- */
    img {
        max-width: 95% !important; /* Ensure images don't stretch too wide */
        height: auto !important;
        display: block;
        margin: 0.8em auto !important; /* Center images with some vertical spacing */
    }

    .thumb {
        float: none !important; /* Remove float for simpler print layout */
        margin: 0.8em auto !important; /* Center the thumbnail container */
        max-width: 200px !important; /* Adjust this to control thumbnail width */
        border: 1px solid #ccc;
        padding: 3px !important; /* Slightly less padding */
        background-color: #f9f9f9;
        box-sizing: border-box;
        page-break-inside: avoid;
    }

    .thumbinner {
        padding: 2px !important; /* Slightly less inner padding */
        border: none !important;
        background-color: transparent !important;
    }

    .thumbimage {
        max-width: 100% !important;
        height: auto !important;
        display: block;
        border: none !important;
    }

    .thumbcaption {
        font-size: 7.5pt !important; /* REDUCED from 8pt */
        line-height: 1.2em !important;
        padding: 2px 0 !important;
        text-align: left !important;
        overflow: hidden !important;
    }

    /* --- Column Layout Adjustments --- */
    .module, .div-col {
        column-count: 1 !important; /* Force single column for print readability */
        column-width: auto !important;
        column-rule: none !important;
    }
    .div-col li, .div-col dd, .div-col p {
        break-inside: avoid;
    }
}