Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.css

MediaWiki interface page
Revision as of 00:22, 21 October 2025 by Romanio0089 (talk | contribs)

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)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* CSS placed here will be applied to all skins */
@media (max-width: 768px) {
  .infobox {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 5px !important;
  }
}

/***** Infobox (sitewide) *****/

/* Light theme defaults */
.mw-parser-output .infobox {
  /* palette via CSS vars (Common.css supports them) */
  --ibox-bg: #fff;
  --ibox-text: #202122;
  --ibox-border: #a2a9b1;
  --ibox-hdr-bg: #f6f7f8;
  --ibox-row-hdr-bg: #f8f9fa;

  background: var(--ibox-bg);
  color: var(--ibox-text);
  border: 1px solid var(--ibox-border);
  border-collapse: collapse;
  float: right;
  clear: right;
  margin-left: 1em;
  margin-bottom: 1em;
  width: 300px;
}

/* Cells */
.mw-parser-output .infobox th,
.mw-parser-output .infobox td {
  border-bottom: 1px solid var(--ibox-border);
  padding: 6px 5px;
  vertical-align: top;
}

/* Title row */
.mw-parser-output .infobox .ibox-title {
  background: var(--ibox-hdr-bg);
  text-align: center;
  font-weight: bold;
  border-bottom: 1px solid var(--ibox-border);
  padding: 8px 10px;
}

/* Image row */
.mw-parser-output .infobox .ibox-image {
  text-align: center;
  padding: 10px;
  border-bottom: 1px solid var(--ibox-border);
}

/* Left column headers */
.mw-parser-output .infobox .ibox-rowhead {
  background: var(--ibox-row-hdr-bg);
  text-align: left;
  white-space: nowrap;
}

/* ---- Dark-mode overrides ---- */

/* Poncho: <body class="poncho-dark-mode"> */
body.poncho-dark-mode .mw-parser-output .infobox {
  --ibox-bg: #1c252e;
  --ibox-text: #e6e6e6;
  --ibox-border: #6b7785;
  --ibox-hdr-bg: #353f47;
  --ibox-row-hdr-bg: #262f39;
}

/* Citizen: <html class="skin-citizen-dark"> */
html.skin-citizen-dark .mw-parser-output .infobox {
  --ibox-bg: #1c252e;
  --ibox-text: #e6e6e6;
  --ibox-border: #6b7785;
  --ibox-hdr-bg: #353f47;
  --ibox-row-hdr-bg: #262f39;
}

/* Optional explicit light reset when Citizen toggles classes without reload */
html.skin-citizen-light .mw-parser-output .infobox {
  --ibox-bg: #fff;
  --ibox-text: #202122;
  --ibox-border: #a2a9b1;
  --ibox-hdr-bg: #f6f7f8;
  --ibox-row-hdr-bg: #f8f9fa;
}

/* Fallback: respect OS preference if a skin doesn’t set a class */
@media (prefers-color-scheme: dark) {
  .mw-parser-output .infobox {
    --ibox-bg: #1c252e;
    --ibox-text: #e6e6e6;
    --ibox-border: #6b7785;
    --ibox-hdr-bg: #353f47;
    --ibox-row-hdr-bg: #262f39;
  }
}