Jump to content

MediaWiki:Common.css: Difference between revisions

From HCF Wiki
No edit summary
No edit summary
Tag: Manual revert
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
  *
  *
  * WHAT IT FIXES
  * WHAT IT FIXES
  * Boxes, infoboxes and tables whose background colour is hardcoded in wikitext
  * Pages whose background colour is hardcoded in wikitext or in a template —
* or in a template — style="background:#fffbe6" and similar. The dark theme
* style="background:#fffbe6" and similar. The dark theme makes body text
  * makes body text light, but it cannot change a background that is written
  * light, but it cannot change a background written into the page, so those
* into the page, so those boxes end up light text on a light fill.
* boxes end up light text on a light fill.
  *
  *
  * This forces dark, readable text inside any element that carries its own
  * WHAT IT LEAVES ALONE
  * inline background, and restores link colours that suit a light fill.
* Anything already using theme variables — style="background:var(--hcf-stone)".
* That content follows dark and light mode on its own and must not be
  * overridden, or it ends up dark text on a dark fill: the same bug in reverse.
* The :not( [style*="var(--"] ) guard on every rule is what draws that line.
  *
  *
  * THIS IS A STOPGAP
  * THIS IS A STOPGAP
  * The proper fix is to add class="notheme" to those templates — that is
  * The proper fix is class="notheme" on the templates producing those boxes —
  * MediaWiki's official opt-out and the skin honours it correctly. Once every
  * MediaWiki's official opt-out, which the skin honours. Better still, convert
  * template has it, you can delete this file. Until then this keeps the wiki
* them to var() colours as the Main Page was. Once no page has a hardcoded
* readable without editing a single page.
  * background left, delete this file.
  */
  */


.mw-parser-output [style*="background"] {
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) {
color: #1d1f24;
color: #1d1f24;
}
}


.mw-parser-output [style*="background"] a {
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) a {
color: #0a6b78;
color: #0a6b78;
}
}


.mw-parser-output [style*="background"] a.new {
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) a.new {
color: #b32020;
color: #b32020;
}
}


.mw-parser-output [style*="background"] a.external {
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) a.external {
color: #2a5fb0;
color: #2a5fb0;
}
}


/* Headings inside those boxes, which otherwise inherit the light heading colour. */
/* Headings inside those boxes, which otherwise inherit the light heading colour. */
.mw-parser-output [style*="background"] h1,
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) h1,
.mw-parser-output [style*="background"] h2,
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) h2,
.mw-parser-output [style*="background"] h3,
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) h3,
.mw-parser-output [style*="background"] h4 {
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) h4 {
color: #1d1f24;
color: #1d1f24;
}
}


/* Muted/secondary text inside them. */
/* Muted and secondary text inside them. */
.mw-parser-output [style*="background"] .mw-editsection,
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) .mw-editsection,
.mw-parser-output [style*="background"] small {
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) small {
color: #5b6270;
color: #5b6270;
}
}

Latest revision as of 12:21, 24 September 2026

/*
 * HCF theme — legacy content patch
 *
 * Paste this into MediaWiki:Common.css.
 *
 * WHAT IT FIXES
 * Pages whose background colour is hardcoded in wikitext or in a template —
 * style="background:#fffbe6" and similar. The dark theme makes body text
 * light, but it cannot change a background written into the page, so those
 * boxes end up light text on a light fill.
 *
 * WHAT IT LEAVES ALONE
 * Anything already using theme variables — style="background:var(--hcf-stone)".
 * That content follows dark and light mode on its own and must not be
 * overridden, or it ends up dark text on a dark fill: the same bug in reverse.
 * The :not( [style*="var(--"] ) guard on every rule is what draws that line.
 *
 * THIS IS A STOPGAP
 * The proper fix is class="notheme" on the templates producing those boxes —
 * MediaWiki's official opt-out, which the skin honours. Better still, convert
 * them to var() colours as the Main Page was. Once no page has a hardcoded
 * background left, delete this file.
 */

.mw-parser-output [style*="background"]:not( [style*="var(--"] ) {
	color: #1d1f24;
}

.mw-parser-output [style*="background"]:not( [style*="var(--"] ) a {
	color: #0a6b78;
}

.mw-parser-output [style*="background"]:not( [style*="var(--"] ) a.new {
	color: #b32020;
}

.mw-parser-output [style*="background"]:not( [style*="var(--"] ) a.external {
	color: #2a5fb0;
}

/* Headings inside those boxes, which otherwise inherit the light heading colour. */
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) h1,
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) h2,
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) h3,
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) h4 {
	color: #1d1f24;
}

/* Muted and secondary text inside them. */
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) .mw-editsection,
.mw-parser-output [style*="background"]:not( [style*="var(--"] ) small {
	color: #5b6270;
}