MediaWiki:Common.css: Difference between revisions

From WesterosLive Wiki
Apply westeros dark theme (automated)
Apply westeros dark theme (automated)
Line 1: Line 1:
/* MediaWiki:Common.css — pushed by ops/wiki/scripts/apply_wiki_skin.sh
/* Dark theme, inlined into every page's <head> via a BeforePageDisplay
  * Forces a dark theme + Georgia serif styling matching guide.westeros.live,
* hook in LocalSettings.php (see ops/wiki/scripts/apply_wiki_skin.sh
  * regardless of the reader's OS/browser color-scheme preference (Vector's
  * MediaWiki:Common.css alone doesn't reliably apply on this install, a
  * skin.json "night mode" is a per-user opt-in toggle, not a server-wide
  * ResourceLoader quirk only caught by rendering with a real headless
* default in 1.42 — a full Common.css override is the reliable way to make
  * browser). Matches guide.westeros.live's Georgia serif / gold-parchment
  * every visitor see the same dark, in-universe look).
  * look. Palette source of truth: web/guide-site/index.html — keep both
* Palette source of truth: web/guide-site/index.html. Keep both in sync if
* in sync if the guide site's colors ever change.
* the guide site's colors ever change.
*
* All colors are CSS custom properties below — change a value here and
* re-dispatch {"action": "apply_skin"} to repaint the whole wiki. No need
* to touch any of the selector rules further down.
  */
  */


:root {
:root {
   color-scheme: dark;
   color-scheme: dark;
  --wiki-bg: #14110f;      /* page background */
  --wiki-panel: #1c1815;    /* header/TOC/table/input chrome background */
  --wiki-ink: #f5f0e6;      /* body text — bright, for readability against --wiki-bg */
  --wiki-muted: #c2b394;    /* de-emphasized text (footer, edit-section links) */
  --wiki-gold: #d4af5a;    /* headings, links */
  --wiki-gold-hover: #f5f0e6; /* link hover — swaps to --wiki-ink for contrast */
  --wiki-rule: #4a3f33;    /* borders/dividers */
}
}


Line 16: Line 26:
.skin-vector,
.skin-vector,
.mw-page-container {
.mw-page-container {
   background: #14110f !important;
   background: var(--wiki-bg) !important;
   color: #e8ddc8 !important;
   color: var(--wiki-ink) !important;
   font-family: Georgia, 'Times New Roman', serif !important;
   font-family: Georgia, 'Times New Roman', serif !important;
}
}
Line 27: Line 37:
.vector-page-toolbar,
.vector-page-toolbar,
.vector-sitenotice-container {
.vector-sitenotice-container {
   background: #14110f !important;
   background: var(--wiki-bg) !important;
   color: #e8ddc8 !important;
   color: var(--wiki-ink) !important;
   border-color: #3a3128 !important;
   border-color: var(--wiki-rule) !important;
}
}


.mw-body {
.mw-body {
   border: 1px solid #3a3128 !important;
   border: 1px solid var(--wiki-rule) !important;
}
}


Line 42: Line 52:
#p-logo-text,
#p-logo-text,
.vector-sticky-pinned-container {
.vector-sticky-pinned-container {
   background: #1c1815 !important;
   background: var(--wiki-panel) !important;
   color: #e8ddc8 !important;
   color: var(--wiki-ink) !important;
}
}


Line 49: Line 59:
.mw-first-heading,
.mw-first-heading,
.vector-menu-heading-label {
.vector-menu-heading-label {
   color: #c9a24b !important;
   color: var(--wiki-gold) !important;
   border-color: #3a3128 !important;
   border-color: var(--wiki-rule) !important;
}
}


a, a:visited {
a, a:visited {
   color: #c9a24b !important;
   color: var(--wiki-gold) !important;
}
}
a:hover {
a:hover {
   color: #e8ddc8 !important;
   color: var(--wiki-gold-hover) !important;
}
}


.mw-editsection a { color: #a89a7d !important; }
.mw-editsection a { color: var(--wiki-muted) !important; }


pre, code, .mw-code {
pre, code, .mw-code {
   background: #1c1815 !important;
   background: var(--wiki-panel) !important;
   color: #e8ddc8 !important;
   color: var(--wiki-ink) !important;
   border: 1px solid #3a3128 !important;
   border: 1px solid var(--wiki-rule) !important;
}
}


table, .wikitable {
table, .wikitable {
   background: #1c1815 !important;
   background: var(--wiki-panel) !important;
   color: #e8ddc8 !important;
   color: var(--wiki-ink) !important;
   border-color: #3a3128 !important;
   border-color: var(--wiki-rule) !important;
}
}
.wikitable > tr > th,
.wikitable > tr > th,
.wikitable > * > tr > th {
.wikitable > * > tr > th {
   background: #1c1815 !important;
   background: var(--wiki-panel) !important;
   color: #c9a24b !important;
   color: var(--wiki-gold) !important;
   border-color: #3a3128 !important;
   border-color: var(--wiki-rule) !important;
}
}
.wikitable > tr > td,
.wikitable > tr > td,
.wikitable > * > tr > td {
.wikitable > * > tr > td {
   border-color: #3a3128 !important;
   border-color: var(--wiki-rule) !important;
}
}


input, textarea, select, .cdx-text-input__input {
input, textarea, select, .cdx-text-input__input {
   background: #1c1815 !important;
   background: var(--wiki-panel) !important;
   color: #e8ddc8 !important;
   color: var(--wiki-ink) !important;
   border-color: #3a3128 !important;
   border-color: var(--wiki-rule) !important;
}
}


Line 93: Line 103:
.vector-menu-dropdown,
.vector-menu-dropdown,
.vector-dropdown-content {
.vector-dropdown-content {
   background: #1c1815 !important;
   background: var(--wiki-panel) !important;
   color: #e8ddc8 !important;
   color: var(--wiki-ink) !important;
}
}


.mw-footer, #footer {
.mw-footer, #footer {
   background: #14110f !important;
   background: var(--wiki-bg) !important;
   color: #a89a7d !important;
   color: var(--wiki-muted) !important;
   border-color: #3a3128 !important;
   border-color: var(--wiki-rule) !important;
}
}


Line 110: Line 120:
[class*="vector-pinned-container"],
[class*="vector-pinned-container"],
[class*="vector-dropdown"] {
[class*="vector-dropdown"] {
   background: #1c1815 !important;
   background: var(--wiki-panel) !important;
   color: #e8ddc8 !important;
   color: var(--wiki-ink) !important;
   border-color: #3a3128 !important;
   border-color: var(--wiki-rule) !important;
}
}
[class*="vector-toc"] a,
[class*="vector-toc"] a,
[class*="vector-pinnable"] a {
[class*="vector-pinnable"] a {
   color: #e8ddc8 !important;
   color: var(--wiki-ink) !important;
}
}
[class*="vector-toc"] a:hover,
[class*="vector-toc"] a:hover,
[class*="vector-pinnable"] a:hover {
[class*="vector-pinnable"] a:hover {
   color: #c9a24b !important;
   color: var(--wiki-gold) !important;
}
}


button, .cdx-button, .mw-ui-button, [class*="cdx-"] {
button, .cdx-button, .mw-ui-button, [class*="cdx-"] {
   background: #1c1815 !important;
   background: var(--wiki-panel) !important;
   color: #e8ddc8 !important;
   color: var(--wiki-ink) !important;
   border-color: #3a3128 !important;
   border-color: var(--wiki-rule) !important;
}
}


Line 132: Line 142:
  * loaded after this stylesheet with equal specificity + !important, which
  * loaded after this stylesheet with equal specificity + !important, which
  * wins on source order alone — `html body` prefixes beat that regardless
  * wins on source order alone — `html body` prefixes beat that regardless
  * of load order. Also kills the white scroll-fade gradient overlay Vector
  * of load order. */
* draws at the bottom/edges of a scrollable TOC. */
html body button,
html body button,
html body .cdx-button,
html body .cdx-button,
Line 139: Line 148:
html body [class*="vector-pinnable"],
html body [class*="vector-pinnable"],
html body [class*="vector-pinned-container"] {
html body [class*="vector-pinned-container"] {
   background: #1c1815 !important;
   background: var(--wiki-panel) !important;
   color: #e8ddc8 !important;
   color: var(--wiki-ink) !important;
   border-color: #3a3128 !important;
   border-color: var(--wiki-rule) !important;
}
}
/* Kills fade/scroll-shadow pseudo-elements Vector draws around pinnable
* chrome (TOC, sticky sidebar) — some hardcode a white linear-gradient
* directly in their ::after, invisible to any class-name-based selector
* and only found by inspecting computed styles directly. */
[class*="vector-toc"]::before,
[class*="vector-toc"]::before,
[class*="vector-toc"]::after,
[class*="vector-toc"]::after,
Line 152: Line 166:
   background-image: none !important;
   background-image: none !important;
}
}
/* The actual culprit (found via computed-style inspection):
* .vector-sticky-pinned-container::after has a hardcoded white fade-out
* gradient (linear-gradient(rgba(255,255,255,0), rgb(255,255,255))) that
* doesn't match "vector-toc"/"vector-pinnable" wildcards above. */
.vector-sticky-pinned-container {
.vector-sticky-pinned-container {
   background: #1c1815 !important;
   background: var(--wiki-panel) !important;
}
}

Revision as of 19:15, 11 July 2026

/* Dark theme, inlined into every page's <head> via a BeforePageDisplay
 * hook in LocalSettings.php (see ops/wiki/scripts/apply_wiki_skin.sh —
 * MediaWiki:Common.css alone doesn't reliably apply on this install, a
 * ResourceLoader quirk only caught by rendering with a real headless
 * browser). Matches guide.westeros.live's Georgia serif / gold-parchment
 * look. Palette source of truth: web/guide-site/index.html — keep both
 * in sync if the guide site's colors ever change.
 *
 * All colors are CSS custom properties below — change a value here and
 * re-dispatch {"action": "apply_skin"} to repaint the whole wiki. No need
 * to touch any of the selector rules further down.
 */

:root {
  color-scheme: dark;
  --wiki-bg: #14110f;       /* page background */
  --wiki-panel: #1c1815;    /* header/TOC/table/input chrome background */
  --wiki-ink: #f5f0e6;      /* body text — bright, for readability against --wiki-bg */
  --wiki-muted: #c2b394;    /* de-emphasized text (footer, edit-section links) */
  --wiki-gold: #d4af5a;     /* headings, links */
  --wiki-gold-hover: #f5f0e6; /* link hover — swaps to --wiki-ink for contrast */
  --wiki-rule: #4a3f33;     /* borders/dividers */
}

body,
.skin-vector,
.mw-page-container {
  background: var(--wiki-bg) !important;
  color: var(--wiki-ink) !important;
  font-family: Georgia, 'Times New Roman', serif !important;
}

#content,
.vector-body,
.mw-body,
.vector-menu-content,
.vector-page-toolbar,
.vector-sitenotice-container {
  background: var(--wiki-bg) !important;
  color: var(--wiki-ink) !important;
  border-color: var(--wiki-rule) !important;
}

.mw-body {
  border: 1px solid var(--wiki-rule) !important;
}

.vector-header-container,
.vector-header,
.vector-pinnable-header,
.vector-menu-heading,
#p-logo-text,
.vector-sticky-pinned-container {
  background: var(--wiki-panel) !important;
  color: var(--wiki-ink) !important;
}

h1, h2, h3, h4, h5, h6,
.mw-first-heading,
.vector-menu-heading-label {
  color: var(--wiki-gold) !important;
  border-color: var(--wiki-rule) !important;
}

a, a:visited {
  color: var(--wiki-gold) !important;
}
a:hover {
  color: var(--wiki-gold-hover) !important;
}

.mw-editsection a { color: var(--wiki-muted) !important; }

pre, code, .mw-code {
  background: var(--wiki-panel) !important;
  color: var(--wiki-ink) !important;
  border: 1px solid var(--wiki-rule) !important;
}

table, .wikitable {
  background: var(--wiki-panel) !important;
  color: var(--wiki-ink) !important;
  border-color: var(--wiki-rule) !important;
}
.wikitable > tr > th,
.wikitable > * > tr > th {
  background: var(--wiki-panel) !important;
  color: var(--wiki-gold) !important;
  border-color: var(--wiki-rule) !important;
}
.wikitable > tr > td,
.wikitable > * > tr > td {
  border-color: var(--wiki-rule) !important;
}

input, textarea, select, .cdx-text-input__input {
  background: var(--wiki-panel) !important;
  color: var(--wiki-ink) !important;
  border-color: var(--wiki-rule) !important;
}

.vector-menu-tabs,
.vector-menu-dropdown,
.vector-dropdown-content {
  background: var(--wiki-panel) !important;
  color: var(--wiki-ink) !important;
}

.mw-footer, #footer {
  background: var(--wiki-bg) !important;
  color: var(--wiki-muted) !important;
  border-color: var(--wiki-rule) !important;
}

/* Table of contents (Vector 2022) + any other pinnable/Codex chrome —
 * attribute-wildcard so new sub-elements in these components are covered
 * without having to enumerate every exact class name. */
[class*="vector-toc"],
[class*="vector-pinnable"],
[class*="vector-pinned-container"],
[class*="vector-dropdown"] {
  background: var(--wiki-panel) !important;
  color: var(--wiki-ink) !important;
  border-color: var(--wiki-rule) !important;
}
[class*="vector-toc"] a,
[class*="vector-pinnable"] a {
  color: var(--wiki-ink) !important;
}
[class*="vector-toc"] a:hover,
[class*="vector-pinnable"] a:hover {
  color: var(--wiki-gold) !important;
}

button, .cdx-button, .mw-ui-button, [class*="cdx-"] {
  background: var(--wiki-panel) !important;
  color: var(--wiki-ink) !important;
  border-color: var(--wiki-rule) !important;
}

/* Higher-specificity re-declarations: some Codex/Vector component CSS is
 * loaded after this stylesheet with equal specificity + !important, which
 * wins on source order alone — `html body` prefixes beat that regardless
 * of load order. */
html body button,
html body .cdx-button,
html body [class*="vector-toc"],
html body [class*="vector-pinnable"],
html body [class*="vector-pinned-container"] {
  background: var(--wiki-panel) !important;
  color: var(--wiki-ink) !important;
  border-color: var(--wiki-rule) !important;
}

/* Kills fade/scroll-shadow pseudo-elements Vector draws around pinnable
 * chrome (TOC, sticky sidebar) — some hardcode a white linear-gradient
 * directly in their ::after, invisible to any class-name-based selector
 * and only found by inspecting computed styles directly. */
[class*="vector-toc"]::before,
[class*="vector-toc"]::after,
[class*="vector-pinnable"]::before,
[class*="vector-pinnable"]::after,
[class*="vector-sticky"]::before,
[class*="vector-sticky"]::after {
  background: none !important;
  background-image: none !important;
}
.vector-sticky-pinned-container {
  background: var(--wiki-panel) !important;
}