MediaWiki:Common.css: Difference between revisions

From PoliticalSG
No edit summary
No edit summary
Line 1: Line 1:
/* CSS placed here will be applied to all skins */
/* CSS placed here will be applied to all skins */
/* --- INFOBOX STYLING --- */
.infobox-container {
.infobox-container {
     width: 30%;
     width: 30%;
Line 31: Line 33:
}
}


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


/* --- MOBILE AD STYLING --- */
/* --- MOBILE AD STYLING --- */
Line 47: Line 51:
}
}


/* --- DESKTOP AD SIDEBAR STYLING --- */
/* If the user is on a wide desktop, completely hide the mobile banner container */
/* Rips the player out of the layout and floats it on the right side of the screen */
@media screen and (min-width: 601px) {
@media screen and (min-width: 1100px) {
     .wiki-mobile-ad-container {
     .wiki-desktop-ad-sidebar {
         display: none !important;
         display: block !important;
        position: fixed;
        right: 25px;        /* Distance from the right edge of the screen */
        top: 160px;          /* Distance from the top header */
        width: 300px;        /* Matches standard ad layout width */
        height: 600px;      /* TEMPORARY: Gives it height so we can see the test box */
        background-color: rgba(255, 0, 0, 0.1); /* TEMPORARY: Light red tint */
        border: 2px dashed red;                /* TEMPORARY: Red dotted line */
        z-index: 9999;      /* Keeps it floating above content */
     }
     }
}
}


/* --- RESPONSIVE VISIBILITY CONTROLS --- */
 
/* If the screen is too narrow (like a laptop), hide the desktop sidebar so it doesn't overlap text */
/* --- MOBILE RESPONSIVE OVERRIDES --- */
@media screen and (max-width: 1099px) {
/* This section triggers only on mobile phones and small tablets */
     .wiki-desktop-ad-sidebar {
@media screen and (max-width: 768px) {
         display: none !important;
   
    /* Force your custom infobox to dropped down as a full-width row instead of floating */
     .infobox-container {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-top: 15px !important;
        margin-bottom: 15px !important;
        clear: both !important;
    }
   
    /* Ensure the internal infobox table adapts beautifully to full width */
    .infobox-table {
        width: 100% !important;
    }
 
    /* Fix native wiki galleries so they don't overflow horizontally */
    ul.gallery {
         display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        padding: 0 !important;
        width: 100% !important;
     }
     }
}


/* If the user is on a desktop, completely hide the mobile banner container */
    /* Set gallery items to a flexible grid layout (2 images per row on mobile) */
@media screen and (min-width: 601px) {
    li.gallerybox {
     .wiki-mobile-ad-container {
        flex: 1 1 45% !important;
         display: none !important;
        max-width: 50% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }
   
    li.gallerybox div {
        width: 100% !important;
    }
   
     li.gallerybox .thumb img {
        max-width: 100% !important;
         height: auto !important;
     }
     }
}
}

Revision as of 12:13, 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 --- */
/* This section triggers only on mobile phones and small tablets */
@media screen and (max-width: 768px) {
    
    /* Force your custom infobox to dropped down as a full-width row instead of floating */
    .infobox-container {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-top: 15px !important;
        margin-bottom: 15px !important;
        clear: both !important;
    }
    
    /* Ensure the internal infobox table adapts beautifully to full width */
    .infobox-table {
        width: 100% !important;
    }

    /* Fix native wiki galleries so they don't overflow horizontally */
    ul.gallery {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Set gallery items to a flexible grid layout (2 images per row on mobile) */
    li.gallerybox {
        flex: 1 1 45% !important;
        max-width: 50% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }
    
    li.gallerybox div {
        width: 100% !important;
    }
    
    li.gallerybox .thumb img {
        max-width: 100% !important;
        height: auto !important;
    }
}