Jump to content

MediaWiki:Mobile.css: Difference between revisions

From The Odd fellows Wiki
Created page with "========================= MOBILE RESPONSIVE FIXES MediaWiki Common.css =========================: Prevent horizontal scrolling: html, body { max-width: 100%; overflow-x: hidden; } Make images scale properly: img { max-width: 100%; height: auto; } Responsive tables: table { width: 100%; max-width: 100%; overflow-x: auto; display: block; } Infobox mobile behavior: .infobox { float: right; width:..."
 
No edit summary
Line 1: Line 1:
/* =========================
/* =========================
   MOBILE RESPONSIVE FIXES
   MOBILE WIKI OPTIMIZATION
  MediaWiki Common.css
   ========================= */
   ========================= */


/* Prevent horizontal scrolling */
/* Prevent weird mobile zoom behavior */
html, body {
html {
    -webkit-text-size-adjust: 100%;
}
 
/* General body styling */
body,
.mw-body,
.vector-body {
    font-size: 18px;
    line-height: 1.6;
     max-width: 100%;
     max-width: 100%;
     overflow-x: hidden;
     overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    padding-left: 10px;
    padding-right: 10px;
}
/* Paragraphs and lists */
p,
li,
td,
th {
    font-size: 1rem;
    line-height: 1.6;
}
/* Headings */
h1 {
    font-size: 2rem;
    line-height: 1.2;
}
h2 {
    font-size: 1.6rem;
    line-height: 1.3;
}
h3 {
    font-size: 1.3rem;
    line-height: 1.4;
}
h4 {
    font-size: 1.1rem;
}
}


/* Make images scale properly */
/* Images */
img {
img {
     max-width: 100%;
     max-width: 100%;
Line 16: Line 58:
}
}


/* Responsive tables */
/* Tables */
table {
table {
     width: 100%;
     width: 100%;
     max-width: 100%;
     max-width: 100%;
    display: block;
     overflow-x: auto;
     overflow-x: auto;
     display: block;
     border-collapse: collapse;
}
}


/* Infobox mobile behavior */
/* Infobox styling */
.infobox {
.infobox {
     float: right;
     float: none;
     width: 300px;
     width: 100%;
     max-width: 100%;
     max-width: 100%;
     margin: 0 0 1em 1em;
     margin: 1em 0;
    padding: 10px;
     border: 1px solid #aaa;
     border: 1px solid #aaa;
     background: #f9f9f9;
     background-color: #f9f9f9;
    padding: 8px;
     box-sizing: border-box;
     box-sizing: border-box;
    font-size: 1rem;
}
}


/* Mobile layout */
/* Infobox headers */
@media screen and (max-width: 768px) {
.infobox th {
    text-align: left;
    font-weight: bold;
}


    /* Make content fit screen */
/* Sidebar cleanup */
    #content,
#mw-panel,
    .mw-body,
.vector-sidebar,
    .vector-body {
.vector-toc {
        width: 100% !important;
    width: 100%;
        margin: 0 !important;
    font-size: 1rem;
        padding: 10px !important;
}
        box-sizing: border-box;
    }


    /* Stack infoboxes */
/* Navigation links */
    .infobox {
a {
        float: none;
    word-break: break-word;
        width: 100%;
}
        margin: 1em 0;
    }


    /* Better text sizing */
/* Code blocks */
     body {
pre,
        font-size: 16px;
code {
        line-height: 1.5;
     overflow-x: auto;
    }
    max-width: 100%;
    font-size: 0.95rem;
}


    /* Prevent giant headings */
/* Category links */
    h1 {
.catlinks {
        font-size: 1.8em;
    font-size: 0.95rem;
    }
}


     h2 {
/* Search bar */
        font-size: 1.4em;
input[type="search"] {
     }
     width: 100%;
    font-size: 1rem;
     box-sizing: border-box;
}


    h3 {
/* Buttons */
        font-size: 1.2em;
button,
    }
input[type="submit"] {
    font-size: 1rem;
}


    /* Navigation cleanup */
/* Prevent content overflow */
    #mw-panel,
div,
     .vector-sidebar {
span,
        width: 100%;
section {
     }
     max-width: 100%;
 
     box-sizing: border-box;
    /* Responsive tables */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
 
    /* Fix long links/text */
    a,
    p,
    li {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}
}

Revision as of 22:53, 15 May 2026

/* =========================
   MOBILE WIKI OPTIMIZATION
   ========================= */

/* Prevent weird mobile zoom behavior */
html {
    -webkit-text-size-adjust: 100%;
}

/* General body styling */
body,
.mw-body,
.vector-body {
    font-size: 18px;
    line-height: 1.6;
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    padding-left: 10px;
    padding-right: 10px;
}

/* Paragraphs and lists */
p,
li,
td,
th {
    font-size: 1rem;
    line-height: 1.6;
}

/* Headings */
h1 {
    font-size: 2rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.6rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.3rem;
    line-height: 1.4;
}

h4 {
    font-size: 1.1rem;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Tables */
table {
    width: 100%;
    max-width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
}

/* Infobox styling */
.infobox {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 1em 0;
    padding: 10px;
    border: 1px solid #aaa;
    background-color: #f9f9f9;
    box-sizing: border-box;
    font-size: 1rem;
}

/* Infobox headers */
.infobox th {
    text-align: left;
    font-weight: bold;
}

/* Sidebar cleanup */
#mw-panel,
.vector-sidebar,
.vector-toc {
    width: 100%;
    font-size: 1rem;
}

/* Navigation links */
a {
    word-break: break-word;
}

/* Code blocks */
pre,
code {
    overflow-x: auto;
    max-width: 100%;
    font-size: 0.95rem;
}

/* Category links */
.catlinks {
    font-size: 0.95rem;
}

/* Search bar */
input[type="search"] {
    width: 100%;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Buttons */
button,
input[type="submit"] {
    font-size: 1rem;
}

/* Prevent content overflow */
div,
span,
section {
    max-width: 100%;
    box-sizing: border-box;
}