MediaWiki:Common.css: Difference between revisions

Current answers. Practical procedures. Reliable reference.
Jump to navigation Jump to search
Fix: also override display:none on the actual main-menu-landmark nav element (previous fix only restored grid space, not content visibility)
Switch to Vector legacy for a genuinely persistent sidebar (Vector 2022 hard-restricts pinning to logged-in users); add mobile stacking fix
Line 2: Line 2:
  * Original CSS written for this project — no code or assets copied from
  * Original CSS written for this project — no code or assets copied from
  * runescape.wiki or any other site. Visual direction (warm gold/amber
  * runescape.wiki or any other site. Visual direction (warm gold/amber
  * accent, clean dark-mode-capable game-reference layout, right-floated
  * accent, classic always-visible left sidebar, bordered header, right-
  * infoboxes) is loosely inspired by that genre of game wiki, per operator
  * floated infoboxes) is loosely inspired by that genre of game wiki, per
  * request, but implemented from scratch against Vector 2022's own
  * operator request, but implemented from scratch.
  * documented CSS custom properties (see
*
  * skins/Vector/resources/skins.vector.styles/CSSCustomProperties.less in
* SKIN NOTE (2026-08-07): the site uses Vector "legacy" (2011), not
  * MediaWiki core) — not by copying anyone else's stylesheet.
* Vector 2022, specifically because of this layout request. Vector 2022's
  * left sidebar can only ever be "pinned" (persistently visible) for
* logged-in users — its own FeatureManager hard-codes a REQUIREMENT_
  * LOGGED_IN check for the pinned-menu feature (skins/Vector/includes/
* FeatureManagement/FeatureManagerFactory.php), so no LocalSettings
* config or CSS override can make it persistent for anonymous visitors;
* the actual menu content isn't even server-rendered into the sidebar
* DOM location for them, so there's nothing for CSS to reveal. This was
* verified the hard way (screenshot testing 3 different approaches)
* before switching skins — see docs/content-style-guide.md for the full
* account. Vector legacy has no such restriction (no pin/unpin system at
  * all -- the sidebar is unconditionally always rendered), which is
* exactly the classic layout that was asked for, at the cost of legacy's
* weaker built-in mobile responsiveness -- patched below.
  *
  *
  * Keep this file simple. If it grows much further, split it into
  * Keep this file simple. If it grows much further, split it into
Line 13: Line 26:
  */
  */


/* --- Accent colour: shift Vector 2022's default Wikipedia-blue "progressive"
/* --- Accent colour: shift the default Wikipedia-blue "progressive" token
   token family to the amber already used across EDFM's editorial templates
   family to the amber already used across EDFM's editorial templates (see
   (see Template:EDFM style/styles.css). This single override cascades to
   Template:EDFM style/styles.css). Cascades to links, active-tab
  links, active tab underlines, button focus rings, etc. site-wide. */
  underlines, button focus rings, etc. site-wide, in both skins. */
:root {
:root {
--color-progressive: #a15a00;
--color-progressive: #a15a00;
Line 29: Line 42:
--border-color-progressive--active: #5c3400;
--border-color-progressive--active: #5c3400;
}
}
 
a { color: #a15a00; }
html.skin-theme-clientpref-night {
a:visited { color: #8a5a2e; }
--color-progressive: #e3a53d;
a:hover { color: #7a4500; }
--color-progressive--hover: #edbf6b;
--color-progressive--active: #f3d08c;
--color-progressive--focus: #e3a53d;
--background-color-progressive: #e3a53d;
--background-color-progressive--hover: #edbf6b;
--background-color-progressive--active: #f3d08c;
--border-color-progressive: #e3a53d;
--border-color-progressive--hover: #edbf6b;
--border-color-progressive--active: #f3d08c;
}
@media screen and (prefers-color-scheme: dark) {
html.skin-theme-clientpref-os {
--color-progressive: #e3a53d;
--color-progressive--hover: #edbf6b;
--color-progressive--active: #f3d08c;
--color-progressive--focus: #e3a53d;
--background-color-progressive: #e3a53d;
--background-color-progressive--hover: #edbf6b;
--background-color-progressive--active: #f3d08c;
--border-color-progressive: #e3a53d;
--border-color-progressive--hover: #edbf6b;
--border-color-progressive--active: #f3d08c;
}
}


/* --- Sidebar section headings: bolder, wider letter-spacing, accent-tinted
/* --- Sidebar section headings: bolder, wider letter-spacing, accent-tinted
   -- a clean "reference manual nav" feel instead of Vector's plain grey. */
   -- a clean "reference manual nav" feel instead of Vector's plain grey. */
.vector-menu-heading {
.vector-menu-heading {
color: var( --color-progressive );
color: #a15a00;
font-weight: 700;
font-weight: 700;
letter-spacing: 0.02em;
letter-spacing: 0.02em;
Line 67: Line 56:
}
}


/* --- Persistent left sidebar (added 2026-08-07, layout request: "look a bit
/* --- Header: a permanent accent band under the header/tabs area, closer to
   like runescape.wiki" -- specifically their classic always-visible left
   a "branded masthead" feel than a plain white header. Kept restrained --
   nav + header, not their colours/art). Vector 2022's own default behaviour
   no background image, no gradient, just a bottom border. */
  collapses the sidebar to a single column (hidden behind the hamburger
#p-personal,
  toggle) whenever a page has a short table of contents and the visitor
.vector-header-container {
  hasn't manually pinned the menu -- most of our pages are short right now,
border-bottom: 3px solid #a15a00;
  so that was the *default* experience, not an edge case. This restores the
}
   two-column grid Vector already uses for the "pinned" state, applied
#mw-head-base {
   unconditionally at desktop widths, so the sidebar reads as permanent
border-bottom: 3px solid #a15a00;
   navigation the way runescape.wiki's does.
}
  Values mirror Vector's own variables.less (@width-column-desktop = 196px
 
   / 16px browser default = 12.25rem; @min-width-breakpoint-desktop = 1120px)
/* --- Mobile: Vector legacy has no built-in responsive breakpoint (unlike
   -- not guessed, read directly from the installed skin's source so this
   Vector 2022) -- its sidebar is absolutely positioned at a fixed width
   stays visually consistent with Vector's own spacing. Scoped to desktop
   unconditionally, which crams everything at narrow widths. Below 800px,
  widths only; mobile's separate collapsed layout is untouched. */
   drop the sidebar back into normal document flow (full-width, stacked
@media ( min-width: 1120px ) {
   above the content) instead of leaving it cramped and tiny. Not a fancy
.vector-feature-main-menu-pinned-disabled.vector-toc-not-available .mw-page-container-inner,
   collapsible hamburger menu -- just genuinely readable/tappable, which is
.vector-feature-main-menu-pinned-disabled.vector-feature-toc-pinned-clientpref-0 .mw-page-container-inner {
   the actual requirement. */
grid-template-columns: 12.25rem minmax( 0, 1fr );
@media ( max-width: 800px ) {
grid-template-areas:
#mw-panel {
'siteNotice siteNotice'
position: static;
'columnStart pageContent'
width: auto;
'footer footer';
padding: 0.5em 1em;
}
.mw-body,
#mw-head-base,
#left-navigation,
#mw-data-after-content,
.mw-footer {
margin-left: 0;
}
}
/* This is the rule that actually matters: Vector's own compiled CSS
#p-personal {
  has `.vector-feature-main-menu-pinned-disabled
position: static;
  .vector-main-menu-container .vector-main-menu-landmark { display:
text-align: right;
  none }` -- the grid-column fix above reserves the LAYOUT space, but
padding: 0.25em 1em;
  without this override the actual nav content sitting in that space
  is still individually hidden. Confirmed by reading the real
  compiled CSS (load.php output), not just the .less source -- the
  first attempt at this fix missed this rule entirely and visibly
  did nothing but the header border. */
.vector-feature-main-menu-pinned-disabled .vector-main-menu-container .vector-main-menu-landmark {
display: block;
}
}
/* The pin/unpin toggle becomes a no-op once the sidebar is always
#p-personal ul {
  shown at this width -- hide it rather than leave a button that
padding-left: 0;
  looks interactive but does nothing. The TOC and page-tools pin
  toggles are untouched (only the main-menu one is targeted). */
#vector-main-menu-pinned-container .vector-pinnable-header-toggle-button {
display: none;
}
}
}
/* --- Header: a light, permanent accent band under the header bar, closer to
  a "branded masthead" feel than Vector's default plain white header. Kept
  restrained -- no background image, no gradient, just a bottom border in
  the site accent colour. */
.vector-header-container {
border-bottom: 3px solid var( --color-progressive );
}
}


Line 129: Line 106:
width: 300px;
width: 300px;
margin: 0 0 1.2em 1.2em;
margin: 0 0 1.2em 1.2em;
border: 1px solid var( --border-color-progressive, #a15a00 );
border: 1px solid #a15a00;
background: var( --background-color-interactive-subtle, #f8f4ee );
background: #f8f4ee;
font-size: 0.9em;
font-size: 0.9em;
}
}
.edfm-infobox-title {
.edfm-infobox-title {
background: var( --color-progressive );
background: #a15a00;
color: #fff;
color: #fff;
font-weight: 700;
font-weight: 700;
Line 143: Line 120:
text-align: center;
text-align: center;
padding: 0.6em;
padding: 0.6em;
border-bottom: 1px solid var( --border-color-base, #a2a9b1 );
border-bottom: 1px solid #a2a9b1;
}
}
.edfm-infobox-row {
.edfm-infobox-row {
display: flex;
display: flex;
border-bottom: 1px solid var( --border-color-subtle, #eaecf0 );
border-bottom: 1px solid #eaecf0;
padding: 0.35em 0.6em;
padding: 0.35em 0.6em;
}
}

Revision as of 02:36, 7 August 2026

/* EDFM site-wide styling.
 * Original CSS written for this project — no code or assets copied from
 * runescape.wiki or any other site. Visual direction (warm gold/amber
 * accent, classic always-visible left sidebar, bordered header, right-
 * floated infoboxes) is loosely inspired by that genre of game wiki, per
 * operator request, but implemented from scratch.
 *
 * SKIN NOTE (2026-08-07): the site uses Vector "legacy" (2011), not
 * Vector 2022, specifically because of this layout request. Vector 2022's
 * left sidebar can only ever be "pinned" (persistently visible) for
 * logged-in users — its own FeatureManager hard-codes a REQUIREMENT_
 * LOGGED_IN check for the pinned-menu feature (skins/Vector/includes/
 * FeatureManagement/FeatureManagerFactory.php), so no LocalSettings
 * config or CSS override can make it persistent for anonymous visitors;
 * the actual menu content isn't even server-rendered into the sidebar
 * DOM location for them, so there's nothing for CSS to reveal. This was
 * verified the hard way (screenshot testing 3 different approaches)
 * before switching skins — see docs/content-style-guide.md for the full
 * account. Vector legacy has no such restriction (no pin/unpin system at
 * all -- the sidebar is unconditionally always rendered), which is
 * exactly the classic layout that was asked for, at the cost of legacy's
 * weaker built-in mobile responsiveness -- patched below.
 *
 * Keep this file simple. If it grows much further, split it into
 * per-purpose TemplateStyles sheets instead of one large Common.css.
 */

/* --- Accent colour: shift the default Wikipedia-blue "progressive" token
   family to the amber already used across EDFM's editorial templates (see
   Template:EDFM style/styles.css). Cascades to links, active-tab
   underlines, button focus rings, etc. site-wide, in both skins. */
:root {
	--color-progressive: #a15a00;
	--color-progressive--hover: #7a4500;
	--color-progressive--active: #5c3400;
	--color-progressive--focus: #a15a00;
	--background-color-progressive: #a15a00;
	--background-color-progressive--hover: #7a4500;
	--background-color-progressive--active: #5c3400;
	--border-color-progressive: #a15a00;
	--border-color-progressive--hover: #7a4500;
	--border-color-progressive--active: #5c3400;
}
a { color: #a15a00; }
a:visited { color: #8a5a2e; }
a:hover { color: #7a4500; }

/* --- Sidebar section headings: bolder, wider letter-spacing, accent-tinted
   -- a clean "reference manual nav" feel instead of Vector's plain grey. */
.vector-menu-heading {
	color: #a15a00;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	font-size: 0.8em;
}

/* --- Header: a permanent accent band under the header/tabs area, closer to
   a "branded masthead" feel than a plain white header. Kept restrained --
   no background image, no gradient, just a bottom border. */
#p-personal,
.vector-header-container {
	border-bottom: 3px solid #a15a00;
}
#mw-head-base {
	border-bottom: 3px solid #a15a00;
}

/* --- Mobile: Vector legacy has no built-in responsive breakpoint (unlike
   Vector 2022) -- its sidebar is absolutely positioned at a fixed width
   unconditionally, which crams everything at narrow widths. Below 800px,
   drop the sidebar back into normal document flow (full-width, stacked
   above the content) instead of leaving it cramped and tiny. Not a fancy
   collapsible hamburger menu -- just genuinely readable/tappable, which is
   the actual requirement. */
@media ( max-width: 800px ) {
	#mw-panel {
		position: static;
		width: auto;
		padding: 0.5em 1em;
	}
	.mw-body,
	#mw-head-base,
	#left-navigation,
	#mw-data-after-content,
	.mw-footer {
		margin-left: 0;
	}
	#p-personal {
		position: static;
		text-align: right;
		padding: 0.25em 1em;
	}
	#p-personal ul {
		padding-left: 0;
	}
}

/* --- Generic infobox: a right-floated, bordered reference box, the kind of
   structural element most game-reference wikis use for at-a-glance specs.
   Deliberately plain -- no glow, no gradients, no game-specific chrome.
   See Template:Infobox for usage. */
.edfm-infobox {
	float: right;
	clear: right;
	width: 300px;
	margin: 0 0 1.2em 1.2em;
	border: 1px solid #a15a00;
	background: #f8f4ee;
	font-size: 0.9em;
}
.edfm-infobox-title {
	background: #a15a00;
	color: #fff;
	font-weight: 700;
	text-align: center;
	padding: 0.4em 0.6em;
}
.edfm-infobox-image {
	text-align: center;
	padding: 0.6em;
	border-bottom: 1px solid #a2a9b1;
}
.edfm-infobox-row {
	display: flex;
	border-bottom: 1px solid #eaecf0;
	padding: 0.35em 0.6em;
}
.edfm-infobox-row:last-child {
	border-bottom: none;
}
.edfm-infobox-label {
	font-weight: 700;
	width: 40%;
	flex-shrink: 0;
}
.edfm-infobox-value {
	width: 60%;
}
@media ( max-width: 640px ) {
	.edfm-infobox {
		float: none;
		width: auto;
		margin: 1em 0;
	}
}