MediaWiki:Common.css: Difference between revisions

From PoliticalSG
No edit summary
No edit summary
Line 57: Line 57:
     }
     }
}
}


/* --- MOBILE RESPONSIVE OVERRIDES --- */
/* --- MOBILE RESPONSIVE OVERRIDES --- */
@media screen and (max-width: 768px) {
@media screen and (max-width: 768px) {


     /* 1. Force the outer inline style wrapper to take up 100% full width */
     /* 1. AGGRESSIVELY FORCE THE FLOATING CONTAINER TO COLLAPSE */
     .mw-parser-output > div[style*="float: right"],
     html body .mw-body .mw-parser-output div[style*="float: right"],
     .mw-parser-output > div[style*="float:right"] {
     html body .mw-body .mw-parser-output div[style*="float:right"],
    html body .mw-body .mw-parser-output div[style*="width:30%"],
    html body .mw-body .mw-parser-output div[style*="width: 30%"] {
         float: none !important;
         float: none !important;
         width: 100% !important;
         width: 100% !important;
         max-width: 100% !important;
         max-width: 100% !important;
        min-width: 100% !important;
         margin-left: 0 !important;
         margin-left: 0 !important;
         margin-right: 0 !important;
         margin-right: 0 !important;
Line 76: Line 78:
     }
     }
      
      
     /* 2. FIX THE CROP: Force the internal wikitable to expand fully without squeezed boundaries */
     /* 2. FORCE THE WIKITABLE TO BE FULL WIDTH AND PREVENT CROPPING */
     .mw-parser-output > div[style*="float"] table.wikitable {
     html body .mw-body .mw-parser-output div div table.wikitable,
    html body .mw-body .mw-parser-output div table.wikitable,
    .mw-parser-output table.wikitable {
         width: 100% !important;
         width: 100% !important;
         max-width: 100% !important;
         max-width: 100% !important;
         display: table !important; /* Forces standard tabular structure over flex distortion */
        min-width: 100% !important;
         display: table !important;
         box-sizing: border-box !important;
         box-sizing: border-box !important;
        float: none !important;
     }
     }


     /* 3. CELL RESET: Stop columns inside the infobox table from compressing text into tiny slivers */
     /* 3. RESET TABLE CELL WIDTHS */
     .mw-parser-output > div[style*="float"] table.wikitable td,
    /* Your screenshot shows inline styles like <td style="width:33%"> inside the table.
     .mw-parser-output > div[style*="float"] table.wikitable th {
      This strips those down so they don't break on a mobile phone viewport. */
         width: auto !important; /* Overrides any hardcoded cell pixel/percentage widths */
     html body .mw-body .mw-parser-output table.wikitable tr td,
         white-space: normal !important; /* Forces text wrapping instead of running off-screen */
     html body .mw-body .mw-parser-output table.wikitable tr th {
         word-break: break-word !important; /* Safely breaks long words or non-English characters */
         width: auto !important;  
         padding: 6px 8px !important; /* Normalizes layout padding on mobile devices */
        max-width: 100% !important;
         white-space: normal !important;  
         word-break: break-word !important;  
         padding: 8px !important;
     }
     }


     /* 4. IMAGE RESPONSIVENESS: Ensure the main party logo scaling fits nicely inside the expanded row */
     /* 4. LOGO IMAGE RESIZING */
     .mw-parser-output > div[style*="float"] table.wikitable img {
     html body .mw-body .mw-parser-output table.wikitable img {
         max-width: 100% !important;
         max-width: 100% !important;
         height: auto !important;
         height: auto !important;
     }
     }
}
}

Revision as of 12:30, 24 May 2026

/* CSS placed here will be applied to all skins */

/* --- INFOBOX STYLING --- */
.infobox-container {
    width: 30%;
    max-width: 350px;
    margin-left: 15px;
    margin-top: 0px;
    float: right;
    clear: right;
}

.infobox-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.infobox-image {
    text-align: center;
    padding: 5px;
}

.infobox-header, .infobox-section {
    background-color: #f2f2f2;
    font-weight: bold;
    text-align: center;
}

.infobox-field {
    font-weight: bold;
    width: 35%;
}

/* --- UI CLEANUP --- */
/* Hide wiki UI elements — archive site, not community wiki */
#ca-history { display: none; }
#ca-talk { display: none; }
#ca-edit { display: none; }
#ca-ve-edit { display: none; } /* Visual editor tab if installed */
#p-tb { display: none; }       /* Toolbox sidebar */


/* --- MOBILE AD STYLING --- */
/* Centers the mobile ad banner under the article title */
.wiki-mobile-ad-container {
    display: block;
    text-align: center;
    margin: 15px auto;
    max-width: 100%;
}

/* If the user is on a wide desktop, completely hide the mobile banner container */
@media screen and (min-width: 601px) {
    .wiki-mobile-ad-container {
        display: none !important;
    }
}

/* --- MOBILE RESPONSIVE OVERRIDES --- */
@media screen and (max-width: 768px) {

    /* 1. AGGRESSIVELY FORCE THE FLOATING CONTAINER TO COLLAPSE */
    html body .mw-body .mw-parser-output div[style*="float: right"],
    html body .mw-body .mw-parser-output div[style*="float:right"],
    html body .mw-body .mw-parser-output div[style*="width:30%"],
    html body .mw-body .mw-parser-output div[style*="width: 30%"] {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 15px !important;
        margin-bottom: 15px !important;
        clear: both !important;
        display: block !important;
    }
    
    /* 2. FORCE THE WIKITABLE TO BE FULL WIDTH AND PREVENT CROPPING */
    html body .mw-body .mw-parser-output div div table.wikitable,
    html body .mw-body .mw-parser-output div table.wikitable,
    .mw-parser-output table.wikitable {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        display: table !important;
        box-sizing: border-box !important;
        float: none !important;
    }

    /* 3. RESET TABLE CELL WIDTHS */
    /* Your screenshot shows inline styles like <td style="width:33%"> inside the table. 
       This strips those down so they don't break on a mobile phone viewport. */
    html body .mw-body .mw-parser-output table.wikitable tr td,
    html body .mw-body .mw-parser-output table.wikitable tr th {
        width: auto !important; 
        max-width: 100% !important;
        white-space: normal !important; 
        word-break: break-word !important; 
        padding: 8px !important;
    }

    /* 4. LOGO IMAGE RESIZING */
    html body .mw-body .mw-parser-output table.wikitable img {
        max-width: 100% !important;
        height: auto !important;
    }
}