Jump to content

MediaWiki:Common.css: Difference between revisions

From The Commentary Community Wiki
No edit summary
Tag: Reverted
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Fix text wrapping on mobile - ZachTEW page and similar wiki pages */
.mw-parser-output,
.mw-content-text,
.mw-body-content p,
.mw-body-content li,
.mw-body-content td {
    overflow-wrap: break-word !important;  /* modern standard */
    word-break: break-word !important;      /* fallback for older browsers */
    hyphens: auto;                          /* helps with long words */
}
/* === STRONGER MOBILE INFObOX FIX (ZachTEW page) === */
@media (max-width: 767px) {
    .infobox,
    table.infobox {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 1em 0 !important;
        table-layout: auto !important;          /* changed from fixed → lets content breathe */
        box-sizing: border-box !important;
        border-collapse: collapse !important;
    }


/* Infobox template style */
    .infobox th,
.infobox {
     .infobox td,
     border: 1px solid #aaa;
     table.infobox th,
     background-color: #f9f9f9;
     table.infobox td {
    color: black;
        display: block !important;             /* stacks label + data vertically on phones */
     margin: 0.5em 0 0.5em 1em;
        width: 100% !important;
    padding: 0.2em;
        padding: 8px 10px !important;
    float: right;
        word-break: break-word !important;
    clear: right;
        overflow-wrap: break-word !important;
}
        hyphens: auto !important;
.infobox td,
        white-space: normal !important;
.infobox th {
     }
    vertical-align: top;
}
.infobox caption {
    font-size: larger;
}
.infobox.bordered {
    border-collapse: collapse;
}
.infobox.bordered td,
.infobox.bordered th {
    border: 1px solid #aaa;
}
.infobox.bordered .borderless td,
.infobox.bordered .borderless th {
     border: 0;
}


.infobox.sisterproject {
    /* Make the long links row wrap nicely */
    width: 20em;
    .infobox td a,
    font-size: 90%;
    .infobox td .external,
}
    a[href*="archive.org"],
    a[href*="ghostarchive"],
    a[href*="twitter"],
    a[href*="ZachTEW"] {
        word-break: break-all !important;
        display: inline-block !important;
        margin: 2px 0 !important;
    }


.infobox.standard-talk {
    /* Tighten empty rows (profile pic, etc.) */
    border: 1px solid #c0c090;
     .infobox td:empty,
     background-color: #f8eaba;
    .infobox td[colspan="2"]:empty {
}
        padding: 4px 10px !important;
.infobox.standard-talk.bordered td,
    }
.infobox.standard-talk.bordered th {
    border: 1px solid #c0c090;
}


/* styles for bordered infobox with merged rows */
    /* Kill any leftover scroll */
.infobox.bordered .mergedtoprow td,
    .mw-body,
.infobox.bordered .mergedtoprow th {
    .mw-content-container {
    border: 0;
        overflow-x: hidden !important;
    border-top: 1px solid #aaa;
     }
     border-right: 1px solid #aaa;
}
}


.infobox.bordered .mergedrow td,
/* Optional: prevent horizontal scroll entirely on mobile */
.infobox.bordered .mergedrow th {
@media (max-width: 767px) {
    border: 0;
    .mw-body {
     border-right: 1px solid #aaa;
        overflow-x: hidden;
    }
   
    /* Make references and long URLs wrap nicely */
    .references li,
    .external {
        word-break: break-word;
     }
}
}


/* Styles for geography infoboxes, eg countries,
  country subdivisions, cities, etc.            */
.infobox.geography {
    text-align: left;
    border-collapse: collapse;
    line-height: 1.2em;
    font-size: 90%;
}


.infobox.geography  td,
/* === STRONGER MOBILE FIX FOR ZachTEW INFObOX & LONG TEXT === */
.infobox.geography  th {
@media (max-width: 767px) {
    border-top: solid 1px #aaa;
    .infobox,
    padding: 0.4em 0.6em 0.4em 0.6em;
    table.infobox,
}
    table.infobox.wikitable {
.infobox.geography .mergedtoprow td,
        float: none !important;
.infobox.geography .mergedtoprow th {
        width: 100% !important;
    border-top: solid 1px #aaa;
        max-width: 100% !important;
    padding: 0.4em 0.6em 0.2em 0.6em;
        margin: 0 0 1em 0 !important;
}
        table-layout: fixed !important;
        box-sizing: border-box !important;
    }


.infobox.geography .mergedrow td,
    .infobox td,
.infobox.geography .mergedrow th {
    .infobox th,
    border: 0;
    table.infobox td,
    padding: 0 0.6em 0.2em 0.6em;
    table.infobox th {
}
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        padding: 8px 6px !important;   /* slightly tighter for phones */
    }


.infobox.geography .mergedbottomrow td,
    /* Force the long link cells to wrap aggressively */
.infobox.geography .mergedbottomrow th {
    .infobox td a[href*="archive"],
    border-top: 0;
    .infobox td a[href*="ghostarchive"],
    border-bottom: solid 1px #aaa;
    .infobox td a[href*="twitter"],
     padding: 0 0.6em 0.4em 0.6em;
    .references li a,
}
    .external {
        word-break: break-all !important;
        white-space: normal !important;
     }


.infobox.geography .maptable td,
    /* Kill any remaining scroll */
.infobox.geography .maptable th {
    .mw-body,
    border: 0;
    .mw-content-container {
     padding: 0;
        overflow-x: hidden !important;
     }
}
}

Latest revision as of 03:49, 21 May 2026

/* Fix text wrapping on mobile - ZachTEW page and similar wiki pages */
.mw-parser-output,
.mw-content-text,
.mw-body-content p,
.mw-body-content li,
.mw-body-content td {
    overflow-wrap: break-word !important;   /* modern standard */
    word-break: break-word !important;      /* fallback for older browsers */
    hyphens: auto;                          /* helps with long words */
}

/* === STRONGER MOBILE INFObOX FIX (ZachTEW page) === */
@media (max-width: 767px) {
    .infobox,
    table.infobox {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 1em 0 !important;
        table-layout: auto !important;          /* changed from fixed → lets content breathe */
        box-sizing: border-box !important;
        border-collapse: collapse !important;
    }

    .infobox th,
    .infobox td,
    table.infobox th,
    table.infobox td {
        display: block !important;              /* stacks label + data vertically on phones */
        width: 100% !important;
        padding: 8px 10px !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        white-space: normal !important;
    }

    /* Make the long links row wrap nicely */
    .infobox td a,
    .infobox td .external,
    a[href*="archive.org"],
    a[href*="ghostarchive"],
    a[href*="twitter"],
    a[href*="ZachTEW"] {
        word-break: break-all !important;
        display: inline-block !important;
        margin: 2px 0 !important;
    }

    /* Tighten empty rows (profile pic, etc.) */
    .infobox td:empty,
    .infobox td[colspan="2"]:empty {
        padding: 4px 10px !important;
    }

    /* Kill any leftover scroll */
    .mw-body,
    .mw-content-container {
        overflow-x: hidden !important;
    }
}

/* Optional: prevent horizontal scroll entirely on mobile */
@media (max-width: 767px) {
    .mw-body {
        overflow-x: hidden;
    }
    
    /* Make references and long URLs wrap nicely */
    .references li,
    .external {
        word-break: break-word;
    }
}


/* === STRONGER MOBILE FIX FOR ZachTEW INFObOX & LONG TEXT === */
@media (max-width: 767px) {
    .infobox,
    table.infobox,
    table.infobox.wikitable {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 1em 0 !important;
        table-layout: fixed !important;
        box-sizing: border-box !important;
    }

    .infobox td,
    .infobox th,
    table.infobox td,
    table.infobox th {
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        padding: 8px 6px !important;   /* slightly tighter for phones */
    }

    /* Force the long link cells to wrap aggressively */
    .infobox td a[href*="archive"],
    .infobox td a[href*="ghostarchive"],
    .infobox td a[href*="twitter"],
    .references li a,
    .external {
        word-break: break-all !important;
        white-space: normal !important;
    }

    /* Kill any remaining scroll */
    .mw-body,
    .mw-content-container {
        overflow-x: hidden !important;
    }
}