MediaWiki:Common.css

From MB Wiki
Revision as of 05:06, 11 December 2025 by Ais (talk | contribs)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* =======================================================================
   MB WIKI - OFFICIAL COMMON.CSS
   Theme: Teal/Cyan (Custom) + Terraria Typography
   ======================================================================= */

/* --- 1. Imports & Fonts --- */
/* Only import FontAwesome (Icons). Google Fonts (Fredoka/Rubik) REMOVED for speed/style. */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* --- 2. CSS Variables (Theming) --- */
:root {
    /* -- Typography (Terraria Style) -- */
    --font-family-body: Helvetica, Arial, sans-serif;
    --font-family-heading: Verdana, Helvetica, Arial, sans-serif;
    --font-family-mono: monospace, monospace;
    --font-size-base: 14px;
    --line-height-base: 1.5;

    /* -- Universal Colors (Gray Scale) -- */
    --gray-900: #1a202c;
    --gray-800: #2d3748;
    --gray-700: #4a5568;
    --gray-600: #718096;
    --gray-500: #a0aec0;
    --gray-400: #cbd5e0;
    --gray-300: #e2e8f0;
    --gray-200: #edf2f7;
    --gray-100: #f7fafc;
    --gray-050: #ffffff;
}

/* -- Light Theme Variables -- */
:root body:not(.skin-vector-dark) {
    --theme-page-text-color: #1a2a2a;
    --theme-page-background-color: #f8fdfc;
    --theme-page-background-color--secondary: #e0f7f4;
    
    --theme-link-color: #006d72;
    --theme-link-color--hover: #00474A;
    --theme-border-color: #b2f5ea;
    
    --theme-accent-color: #4fd1c7;
    --theme-highlight-background: #e6fffa;
    --theme-heading-color: #1a2a2a;
    
    /* Box Styles */
    --theme-box-background: #ffffff;
    --theme-box-border-color: #b2f5ea;
}

/* -- Dark Theme Variables -- */
:root .skin-vector-dark {
    --theme-page-text-color: #e2e8f0;
    --theme-page-background-color: #1a202c;
    --theme-page-background-color--secondary: #2d3748;
    
    --theme-link-color: #4fd1c7;
    --theme-link-color--hover: #81e6d9;
    --theme-border-color: #4a5568;
    
    --theme-accent-color: #4fd1c7;
    --theme-highlight-background: #2d3748;
    --theme-heading-color: #e2e8f0;
    
    /* Box Styles */
    --theme-box-background: #2d3748;
    --theme-box-border-color: #4a5568;
}

/* =======================================================================
   3. GLOBAL ELEMENTS & TYPOGRAPHY
   ======================================================================= */
html, body {
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
}

/* Headings - Terraria Style (Verdana) */
h1, h2, h3, h4, h5, h6, .mw-headline, .vector-menu-heading-label {
    font-family: var(--font-family-heading);
    color: var(--theme-heading-color);
    font-weight: normal;
    line-height: 1.25;
    margin-bottom: 0.25em;
}

/* Specific Header Tweaks */
.mw-body h1, .mw-body-content h1 { font-size: 2em; font-weight: normal; }
.mw-body-content h2 { font-size: 1.6em; border-bottom: 1px solid var(--theme-border-color); margin-top: 1em; }
.vector-body h3 { font-size: 1.3em; font-weight: bold; }
.vector-body h4 { font-size: 1.1em; font-weight: bold; }

/* Links */
a, a:visited, .mw-parser-output a.external { color: var(--theme-link-color); text-decoration: none; }
a:hover, .mw-parser-output a.external:hover { color: var(--theme-link-color--hover); text-decoration: underline; }

/* Code Blocks */
code, pre, .mw-code {
    font-family: var(--font-family-mono);
    font-size: 13px;
    background-color: var(--theme-page-background-color--secondary);
    border: 1px solid var(--theme-border-color);
    border-radius: 2px;
    padding: 1px 4px;
}

/* =======================================================================
   4. TEMPLATE COMPONENTS (Infoboxes, Tables, Etc.)
   ======================================================================= */

/* --- Standard Wikitable --- */
.wikitable {
    background-color: transparent;
    border: 1px solid var(--theme-border-color);
    border-collapse: collapse;
    color: var(--theme-page-text-color);
}
.wikitable > tr > th, .wikitable > * > tr > th {
    background-color: #e7c361; /* Keeping your Gold Header */
    color: #000;
    text-align: center;
    border: 1px solid #a2a9b1;
    padding: 0.2em 0.4em;
}
.wikitable > tr > td, .wikitable > * > tr > td {
    border: 1px solid #a2a9b1;
    padding: 0.2em 0.4em;
}

/* --- Terraria-Style InfoCard (New) --- */
.infocard {
    display: inline-block;
    vertical-align: top;
    border: 1px solid var(--theme-border-color);
    background: var(--theme-box-background);
    border-radius: 6px;
    margin: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.infocard .heading {
    background: var(--theme-highlight-background);
    margin: -10px -10px 10px -10px;
    padding: 8px 10px;
    font-weight: bold;
    border-bottom: 1px solid var(--theme-border-color);
    border-radius: 5px 5px 0 0;
    font-family: var(--font-family-heading);
}

/* --- Inline Item (.i) --- */
.i {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    line-height: 1.5;
}
.i img {
    margin-right: 4px;
    image-rendering: pixelated; 
}

/* --- Portable Infobox --- */
.portable-infobox {
    margin: 0 0 15px 15px;
    float: right;
    clear: right;
    width: 300px;
    border: 1px solid #e7c361;
    border-radius: 10px;
    background: var(--theme-box-background);
}
.portable-infobox .pi-title {
    background: #e7c361;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    border-radius: 9px 9px 0 0;
    color: #000;
    font-family: var(--font-family-heading);
    font-size: 1.25em;
}
.portable-infobox .pi-data {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.portable-infobox .pi-data-label { font-weight: bold; }

/* =======================================================================
   5. MAIN PAGE LAYOUT GRID (Critical for your homepage)
   ======================================================================= */
/* Grid System */
.grid {
    display: grid !important;
    grid-template-columns: repeat(12, 1fr);
    gap: 10px;
}
.grid__col12 { grid-column: span 12; }
.grid__col8  { grid-column: span 8; }
.grid__col6  { grid-column: span 6; }
.grid__col4  { grid-column: span 4; }
.grid__col3  { grid-column: span 3; }

/* Mobile Grid Fallback */
@media (max-width: 768px) {
    .grid { display: flex !important; flex-direction: column; }
    .grid > div { width: 100%; margin-bottom: 10px; }
    .mp-box { margin-bottom: 15px; }
}

/* Main Page Boxes (.mp-box) */
.mp-box {
    background: var(--theme-box-background);
    border: 1px solid var(--theme-border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}
.mp-box h2 {
    border-bottom: none;
    margin-top: 0;
    font-family: var(--font-family-heading);
}

/* Icon Links (IconName) */
.iconname {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.iconname img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* =======================================================================
   6. UI ELEMENTS (Buttons, Nav, Etc.)
   ======================================================================= */
/* Buttons */
.mw-ui-button, .oo-ui-buttonElement-button {
    background-color: var(--theme-link-color);
    color: #fff !important;
    border: 1px solid var(--theme-link-color--hover);
    border-radius: 4px;
    font-family: var(--font-family-heading);
    font-weight: bold;
}
.mw-ui-button:hover, .oo-ui-buttonElement-button:hover {
    background-color: var(--theme-link-color--hover);
    text-decoration: none;
}

/* Navigation Menu (Sidebar) */
#mw-panel .vector-menu-heading {
    font-family: var(--font-family-heading);
    font-weight: bold;
    color: var(--theme-heading-color);
}
#mw-panel .vector-menu-content-list li a {
    color: var(--theme-link-color);
}

/* Footer */
#footer {
    background-color: var(--theme-page-background-color--secondary);
    border-top: 1px solid var(--theme-border-color);
    padding: 1.5em;
}