MediaWiki:Common.css

From Holdfast: Nations At War
Revision as of 08:21, 10 October 2025 by Xarkanoth (talk | contribs)
Jump to navigation Jump to search

Note: After saving, 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: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/***** Holdfast Wiki – Modern Base Theme (Holdfast Banner + Parchment Palette) **
   Safe, incremental overrides for Vector/Vector-2022. Keep selectors scoped.
*******************************************************************************/

/* ===== 0) CSS Vars (easy theming) ===== */
:root {
  --hf-font-sans: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  --hf-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Palette (from spec) */
  --hf-bg: #E1DCCE;            /* parchment page background */
  --hf-bg-subtle: #EEEDEB;     /* light cards / toc */
  --hf-fg: #1E1E1D;            /* body text */
  --hf-fg-muted: #63635B;      /* muted text */

  --hf-accent: #886D00;        /* link gold/brass */
  --hf-accent-hover: #5A65EA;  /* hover cobalt */
  --hf-accent-visited: #545DD9;/* visited cobalt (darker) */

  --hf-border: #D9D7D1;        /* soft border */
  --hf-border-strong: #BFB69C; /* stronger border / header line */

  --hf-h2-bg: #3c553c;         /* green section bar (kept from your style) */
  --hf-h2-fg: #ffffff;

  --hf-code-bg: #0f172a;       /* dark code panel */
  --hf-code-fg: #e5e7eb;

  --hf-table-header-bg: #f3f4f6;
  --hf-table-row-alt: #fafafa;

  --hf-warning: #a16207;
  --hf-error:   #b91c1c;
  --hf-info:    #1d4ed8;
  --hf-success: #15803d;
}

/* ===== 1) Base Typography & Layout ===== */
body,
.vector-body {
  color: var(--hf-fg);
  background: var(--hf-bg);
  font-family: var(--hf-font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mw-parser-output > p {
  margin: 0.6em 0 0.9em;
  font-size: 0.98rem;
}

/* Tighten content width a touch on large screens */
@media (min-width: 1200px) {
  .vector-body .mw-content-container {
    max-width: 980px;
  }
}

/* ===== 1.1) Content container background ===== */
#content,
.mw-body,
.vector-body .mw-body {
  background: transparent !important;   /* let parchment show through */
  border: none;
  box-shadow: none;
}

/* ===== 2) Headings ===== */
.mw-parser-output h1,
.mw-parser-output h2,
.mw-parser-output h3,
.mw-parser-output h4 {
  font-weight: 700;
  letter-spacing: .2px;
}

/* Section bar style for H2 */
.mw-parser-output h2 {
  background: var(--hf-h2-bg);
  color: var(--hf-h2-fg);
  border: 1px solid var(--hf-border-strong);
  padding: 0.35em 0.6em;
  margin-top: 1.6em;
  margin-bottom: 0.4em;
  font-variant: small-caps;
}

/* Sub-head underline for H3 */
.mw-parser-output h3 {
  border-bottom: 1px solid var(--hf-border);
  padding-bottom: .2em;
  margin-top: 1.2em;
}

/* ===== 3) Links ===== */
.mw-parser-output a,
a.mw-selflink {
  color: var(--hf-accent);
  text-decoration: none;
}
.mw-parser-output a:hover {
  color: var(--hf-accent-hover);
  text-decoration: underline;
}
.mw-parser-output a:visited {
  color: var(--hf-accent-visited);
}

/* ===== 4) TOC ===== */
.toc,
.mw-table-of-contents {
  background: var(--hf-bg-subtle);
  border: 1px solid var(--hf-border);
  border-radius: 8px;
  padding: 0.6em 0.8em;
}
.tocnumber { color: var(--hf-fg-muted); }

/* ===== 5) Collapsible [show]/[hide] – make it link-blue ===== */
.mw-collapsible-toggle,
.mw-collapsible-toggle .mw-collapsible-text {
  color: var(--hf-accent);
  cursor: pointer;
}
.mw-collapsible-toggle:hover .mw-collapsible-text {
  text-decoration: underline;
}
.mw-collapsible .mw-collapsible-content { padding-top: .4em; }

/* ===== 6) Tables ===== */
.wikitable,
table.wikitable.sortable {
  width: 100%;
  border: 1px solid var(--hf-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  font-size: 0.95rem;
}
.wikitable > tr > th,
.wikitable > * > tr > th {
  background: var(--hf-table-header-bg);
  font-weight: 700;
  border-bottom: 1px solid var(--hf-border-strong);
  padding: 0.55em 0.6em;
}
.wikitable > tr > td,
.wikitable > * > tr > td {
  border-top: 1px solid var(--hf-border);
  padding: 0.5em 0.6em;
}
.wikitable tr:nth-child(even) td { background: var(--hf-table-row-alt); }
.wikitable.sortable th { white-space: nowrap; }

/* ===== 7) Infobox / Navbox (generic) ===== */
.infobox,
.navbox,
.mw-infobox {
  border: 1px solid var(--hf-border);
  border-radius: 10px;
  background: #fff;
  padding: 0;
  overflow: hidden;
}
.infobox .infobox-header,
.navbox .navbox-title {
  background: var(--hf-table-header-bg);
  font-weight: 700;
  padding: 0.6em 0.75em;
  border-bottom: 1px solid var(--hf-border);
}
.infobox td,
.infobox th {
  padding: 0.5em 0.75em !important;
  border-top: 1px solid var(--hf-border);
}

/* ===== 8) Notices / Admonitions ===== */
.hf-notice {
  border-left: 4px solid var(--hf-info);
  background: #eef4ff;
  padding: 0.7em 0.9em;
  margin: 1em 0;
  border-radius: 6px;
}
.hf-notice.warn { border-left-color: var(--hf-warning); background: #fff7e6; }
.hf-notice.error{ border-left-color: var(--hf-error);   background: #ffefef; }
.hf-notice.ok   { border-left-color: var(--hf-success); background: #ecfdf3; }

/* ===== 9) Code Blocks – dark theme ===== */
pre, code, .mw-code,
pre .mw-code,
.syntaxhighlight, pre.mw-code {
  font-family: var(--hf-font-mono);
}
pre,
pre.mw-code,
.syntaxhighlight {
  background: var(--hf-code-bg) !important;
  color: var(--hf-code-fg) !important;
  border: 1px solid #0b1220 !important;
  border-radius: 10px;
  padding: 0.8em 1em !important;
  overflow: auto;
}
code {
  background: #0b1220;
  color: var(--hf-code-fg);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

/* ===== 10) Buttons / Links-as-buttons ===== */
.hf-btn,
a.hf-btn {
  display: inline-block;
  background: var(--hf-accent);
  color: #fff !important;
  padding: 0.45em 0.75em;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none !important;
  font-weight: 600;
}
.hf-btn:hover { background: var(--hf-accent-hover); }
.hf-btn.ghost {
  background: transparent;
  color: var(--hf-accent) !important;
  border-color: var(--hf-accent);
}

/* ===== 11) Images / Thumbs ===== */
.thumb,
.mw-halign-left .thumb,
.mw-halign-right .thumb {
  border: 1px solid var(--hf-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.thumb .thumbcaption {
  background: var(--hf-bg-subtle);
  border-top: 1px solid var(--hf-border);
  padding: 0.4em 0.6em;
}

/* ===== 12) Category box ===== */
.catlinks {
  background: var(--hf-bg-subtle);
  border: 1px solid var(--hf-border);
  border-radius: 8px;
  padding: .3em .6em;
}

/* ============================================================================
   13) SKIN CHROME: Top Banner & Sidebar
   Supports Vector (legacy) and Vector-2022.
   Uses File:BannerImage.png via Special:FilePath for stable URL.
============================================================================ */

/* --- Reset header base backgrounds that fight us --- */
#mw-page-base, #mw-head-base { background: none !important; }

/* VECTOR 2022 header container */
.vector-header-container,
.vector-sticky-header {
  background: linear-gradient(to right, rgba(0,0,0,0) 0%, var(--hf-bg) 95%) !important;
  border-bottom: 2px solid var(--hf-border-strong);
  position: relative;
}

/* Paint the banner only on the left side of the header */
.vector-header-container::before,
.vector-sticky-header::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0; /* left, full height */
  width: min(900px, 55vw);     /* banner occupies left portion */
  background-image: url("/wiki/Special:FilePath/BannerImage.png");
  background-repeat: no-repeat;
  background-position: left top;
  background-size: auto 140px; /* adjust height to taste */
  pointer-events: none;
}

/* Give the header a fixed height to match the banner */
.vector-header,
.vector-sticky-header {
  min-height: 140px; /* same as background-size height */
}

/* VECTOR (legacy) header */
#mw-head {
  background: linear-gradient(to right, rgba(0,0,0,0) 0%, var(--hf-bg) 95%) !important;
  border-bottom: 2px solid var(--hf-border-strong);
  position: relative;
  min-height: 140px;
}
#mw-head::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: min(900px, 55vw);
  background-image: url("/wiki/Special:FilePath/BannerImage.png");
  background-repeat: no-repeat;
  background-position: left top;
  background-size: auto 140px;
  pointer-events: none;
}

/* Keep logo and tabs readable over banner */
.mw-logo, .vector-tab, .vector-menu-tabs, .vector-header .vector-user-links {
  position: relative;
  z-index: 2;
}

/* Sidebar (both Vector skins) */
#mw-panel {
  background-color: #46463E !important;
  color: #EEEDEB !important;
  border-right: 1px solid #63635B;
}
#mw-panel a { color: #EEEDEB !important; }
#mw-panel a:hover { color: var(--hf-accent-hover) !important; }

/* Footer */
#footer, .vector-footer {
  background-color: #46463E;
  color: #EEEDEB;
  border-top: 2px solid var(--hf-border-strong);
}

/* Homepage tiles / generic cards */
.mainpage-box, .portal, .infobox, .vector-featured-feed {
  background: var(--hf-bg-subtle);
  border: 1px solid var(--hf-border);
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
}

/* Soften images on main boxes */
.mainpage-box img { border-radius: 8px; }

/* ============================================================================
   14) Small screens tweaks
============================================================================ */
@media (max-width: 720px) {
  .vector-header-container::before,
  .vector-sticky-header::before,
  #mw-head::before {
    background-size: auto 110px;
    width: 100%;
    opacity: .9;
  }
  .vector-header, .vector-sticky-header, #mw-head { min-height: 110px; }
}