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

MediaWiki:Citizen.css: Difference between revisions

MediaWiki interface page
Move the dark mode content links to the logo hue, so they read as crimson instead of pink; keep missing-page links and light mode unchanged.
Give external and interwiki links the same content link colors as internal ones, so no link keeps the old accent pink in dark mode.
 
(One intermediate revision by the same user not shown)
Line 92: Line 92:
--fw-color-progressive--hover: #ff9ba4;
--fw-color-progressive--hover: #ff9ba4;
--fw-color-progressive--active: #ff6b78;
--fw-color-progressive--active: #ff6b78;
--fw-color-content-link: #ff7266;
--fw-color-content-link: #fd2757;
--fw-color-content-link--hover: #ff8d81;
--fw-color-content-link--hover: #ff566d;
--fw-color-content-link--active: #fb655a;
--fw-color-content-link--active: #f41650;
--fw-color-content-link-missing: #dca4ac;
--fw-color-content-link-missing: #dca4ac;
--fw-color-content-link-missing--hover: #e7b5bc;
--fw-color-content-link-missing--hover: #e7b5bc;
Line 127: Line 127:
--fw-color-progressive--hover: #ff9ba4;
--fw-color-progressive--hover: #ff9ba4;
--fw-color-progressive--active: #ff6b78;
--fw-color-progressive--active: #ff6b78;
--fw-color-content-link: #ff7266;
--fw-color-content-link: #fd2757;
--fw-color-content-link--hover: #ff8d81;
--fw-color-content-link--hover: #ff566d;
--fw-color-content-link--active: #fb655a;
--fw-color-content-link--active: #f41650;
--fw-color-content-link-missing: #dca4ac;
--fw-color-content-link-missing: #dca4ac;
--fw-color-content-link-missing--hover: #e7b5bc;
--fw-color-content-link-missing--hover: #e7b5bc;
Line 312: Line 312:
@media screen {
@media screen {
#bodyContent a[href]:where(:not(
#bodyContent a[href]:where(:not(
.external,
.extiw,
.image,
.image,
.mw-file-description,
.mw-file-description,

Latest revision as of 01:13, 26 September 2026

/* All CSS here will be loaded for users of the Citizen skin */

/*
 * Wires the `--fw-*` variables from MediaWiki:Common.css into the Citizen skin,
 * and adds the decorative background images.
 *
 * To swap an image: upload a new version of the file (Special:ListFiles), or
 * change the URL below. To remove one: delete its `background-image` line.
 */

/**
 * Background images
 */
@media screen {
	/* Hero image at the top of every page */
	.citizen-page-container::before {
		background-image: url(/images/4/4f/Theme_hero_panorama.jpg);
		background-position: 70% center;
	}

	/* Behind the site header (left bar on desktop) */
	.citizen-header::before {
		background-image: url(/images/1/13/Theme_header_image.webp);
	}

	/* Vertical inscription along the left edge of the content */
	.citizen-body-container::after {
		background-image: url(/images/f/f9/Theme_inscription_vertical.svg);
	}
}

/* Faint map behind the content, desktop only */
@media screen and (min-width: 1120px) {
	.mw-body::before {
		background-image: url(/images/f/f5/Theme_background_map.svg);
	}
}

/**
 * Theme: light (default)
 */
:root {
	--color-surface-0: var(--fw-color-surface-0);
	--color-surface-1: var(--fw-color-surface-1);
	--color-surface-2: var(--fw-color-surface-2);
	--color-surface-3: var(--fw-color-surface-3);
	--color-surface-4: var(--fw-color-surface-4);
	--color-base: var(--fw-color-base);
	--color-emphasized: var(--fw-color-emphasized);
	--color-subtle: var(--fw-color-subtle);
	--color-progressive: var(--fw-color-progressive);
	--color-progressive--hover: var(--fw-color-progressive--hover);
	--color-progressive--active: var(--fw-color-progressive--active);
	--background-color-progressive: var(--fw-background-color-progressive);
	--background-color-progressive--hover: var(--fw-background-color-progressive--hover);
	--background-color-progressive--active: var(--fw-background-color-progressive--active);
	--color-inverted-primary: var(--fw-color-inverted-progressive);
	--color-inverted-fixed: var(--fw-color-inverted-progressive);
	--border-color-base: var(--fw-border-color-base);
	--border-color-subtle: var(--fw-border-color-subtle);
	--border-color-interactive: var(--fw-border-color-interactive);
	--font-family-citizen-base: var(--fw-font-family-body);

	--color-progressive-oklch__l: 45.64%;
	--color-progressive-oklch__c: 0.1856;
	--color-progressive-oklch__h: 27.27;
	--color-progressive-hsl__h: 355.27;
	--color-progressive-hsl__s: 98.8%;
	--color-progressive-hsl__l: 32.75%;

	--fw-inscription-size: 8px;
}

/**
 * Theme: dark
 */
:root.skin-theme-clientpref-night,
:root.skin-theme-clientpref-black {
	--fw-border-color-base: rgba(255, 255, 255, 0.05);
	--fw-border-color-subtle: rgba(255, 255, 255, 0.02);
	--fw-border-color-interactive: rgba(255, 255, 255, 0.08);
	--fw-color-base: #e4ddcf;
	--fw-color-emphasized: #fbf8f1;
	--fw-color-subtle: #e3d2b0;
	--fw-color-surface-0: #1a1a1f;
	--fw-color-surface-1: #1f1f24;
	--fw-color-surface-2: #23232e;
	--fw-color-surface-3: #282833;
	--fw-color-surface-4: #2c2c3c;
	--fw-color-surface-5: #313142;
	--fw-color-progressive: #ff7b86;
	--fw-color-progressive--hover: #ff9ba4;
	--fw-color-progressive--active: #ff6b78;
	--fw-color-content-link: #fd2757;
	--fw-color-content-link--hover: #ff566d;
	--fw-color-content-link--active: #f41650;
	--fw-color-content-link-missing: #dca4ac;
	--fw-color-content-link-missing--hover: #e7b5bc;
	--fw-color-content-link-missing--active: #d49aa3;
	--fw-opacity-pattern: 0.05;
	--fw-filter-wordmark: drop-shadow(0 0 1px rgba(255, 80, 95, 0.4)) drop-shadow(0 0 8px rgba(255, 48, 66, 0.35));

	--color-progressive-oklch__l: 73.86%;
	--color-progressive-oklch__c: 0.1608;
	--color-progressive-oklch__h: 16.7;
	--color-progressive-hsl__h: 355;
	--color-progressive-hsl__s: 100%;
	--color-progressive-hsl__l: 74.12%;
}

/* Dark theme, when following the operating system setting */
@media screen and (prefers-color-scheme: dark) {
	:root.skin-theme-clientpref-os {
		--fw-border-color-base: rgba(255, 255, 255, 0.05);
		--fw-border-color-subtle: rgba(255, 255, 255, 0.02);
		--fw-border-color-interactive: rgba(255, 255, 255, 0.08);
		--fw-color-base: #e4ddcf;
		--fw-color-emphasized: #fbf8f1;
		--fw-color-subtle: #e3d2b0;
		--fw-color-surface-0: #1a1a1f;
		--fw-color-surface-1: #1f1f24;
		--fw-color-surface-2: #23232e;
		--fw-color-surface-3: #282833;
		--fw-color-surface-4: #2c2c3c;
		--fw-color-surface-5: #313142;
		--fw-color-progressive: #ff7b86;
		--fw-color-progressive--hover: #ff9ba4;
		--fw-color-progressive--active: #ff6b78;
		--fw-color-content-link: #fd2757;
		--fw-color-content-link--hover: #ff566d;
		--fw-color-content-link--active: #f41650;
		--fw-color-content-link-missing: #dca4ac;
		--fw-color-content-link-missing--hover: #e7b5bc;
		--fw-color-content-link-missing--active: #d49aa3;
		--fw-opacity-pattern: 0.05;
		--fw-filter-wordmark: drop-shadow(0 0 1px rgba(255, 80, 95, 0.4)) drop-shadow(0 0 8px rgba(255, 48, 66, 0.35));

		--color-progressive-oklch__l: 73.86%;
		--color-progressive-oklch__c: 0.1608;
		--color-progressive-oklch__h: 16.7;
		--color-progressive-hsl__h: 355;
		--color-progressive-hsl__s: 100%;
		--color-progressive-hsl__l: 74.12%;
	}
}

/* Pure black variant of the dark theme */
:root.skin-theme-clientpref-black,
:root.skin-theme-clientpref-night.citizen-feature-pure-black-clientpref-1 {
	--fw-color-surface-0: #000;
	--fw-color-surface-1: #111;
	--fw-color-surface-2: #222;
	--fw-color-surface-3: #333;
	--fw-color-surface-4: #444;
	--fw-color-surface-5: #555;
}

@media screen and (prefers-color-scheme: dark) {
	:root.skin-theme-clientpref-os.citizen-feature-pure-black-clientpref-1 {
		--fw-color-surface-0: #000;
		--fw-color-surface-1: #111;
		--fw-color-surface-2: #222;
		--fw-color-surface-3: #333;
		--fw-color-surface-4: #444;
		--fw-color-surface-5: #555;
	}
}

/**
 * Typography
 */
h1,
h2,
h3,
h4,
h5,
h6,
.citizen-page-heading,
.mw-logo-wordmark {
	font-family: var(--fw-font-family-heading);
}

/* Wordmark size; do not invert it in dark mode */
img.mw-logo-wordmark {
	height: 2rem;
	filter: none;
}

@media screen and (min-width: 640px) {
	img.mw-logo-wordmark {
		height: 2.5rem;
	}
}

/* Sticky header appears 100px later, below the hero image */
#citizen-page-header-sticky-sentinel {
	transform: translateY(100px);
}

/**
 * Background image plumbing
 */
.citizen-page-container,
.citizen-body-container {
	position: relative;
}

.citizen-header::before,
.citizen-page-container::before,
.mw-body::before,
.citizen-body-container::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.citizen-header::before,
.citizen-page-container::before {
	background-repeat: no-repeat;
}

.mw-body::before,
.citizen-body-container::after {
	background-repeat: repeat-y;
	filter: var(--filter-invert);
}

.citizen-header::before {
	background-position: center left;
	background-size: contain;
	mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.2), transparent 32px);
	-webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.2), transparent 32px);
}

.citizen-page-container::before {
	height: 200px;
	background-size: cover;
	mask-image: linear-gradient(
		rgba(0, 0, 0, 0.35),
		rgba(0, 0, 0, 0.2) 3rem,
		rgba(0, 0, 0, 0.05) 9rem,
		transparent 100%
	);
	-webkit-mask-image: linear-gradient(
		rgba(0, 0, 0, 0.35),
		rgba(0, 0, 0, 0.2) 3rem,
		rgba(0, 0, 0, 0.05) 9rem,
		transparent 100%
	);
}

.mw-body::before {
	position: fixed;
	margin-left: calc(var(--fw-inscription-size) + var(--padding-page));
	opacity: calc(var(--fw-opacity-pattern) * 0.5);
	background-repeat: repeat;
	mask-image: linear-gradient(transparent, #000 480px, #000 calc(100% - 480px), transparent);
	-webkit-mask-image: linear-gradient(transparent, #000 480px, #000 calc(100% - 480px), transparent);
}

.citizen-body-container::after {
	background-size: var(--fw-inscription-size);
	opacity: var(--fw-opacity-pattern);
	mask-image: linear-gradient(transparent, #000 160px, #000 calc(100% - 160px), transparent);
	-webkit-mask-image: linear-gradient(transparent, #000 160px, #000 calc(100% - 160px), transparent);
}

@media screen and (min-width: 1120px) {
	:root {
		--fw-inscription-size: 32px;
	}

	/* Room for the header background image */
	.citizen-header {
		padding-top: 36px;
	}

	.citizen-header::before {
		background-position: top center;
		mask-image: linear-gradient(rgba(0, 0, 0, 0.2), transparent 64px);
		-webkit-mask-image: linear-gradient(rgba(0, 0, 0, 0.2), transparent 64px);
	}

	/* Room for the inscription */
	.citizen-page-header,
	.citizen-body-container {
		padding-left: calc(var(--fw-inscription-size) + var(--padding-page));
	}
}

@media screen and (min-width: 1680px) {
	:root {
		--fw-inscription-size: 3vw;
	}
}

/* Main page: show the content first, the title block below it */
.page-Main_Page .citizen-body-container {
	grid-template-areas:
		'content'
		'header'
		'afterHeader'
		'footer';
}

a.new:where(:not(.cdx-button, [role='button'])) {
	text-decoration: underline dotted;
	text-underline-offset: 0.15em;
}

@media screen {
	#bodyContent a[href]:where(:not(
		.image,
		.mw-file-description,
		.cdx-button,
		.mw-ui-button,
		.oo-ui-buttonElement-button,
		[role='button'],
		[href^='#'],
		.mw-editsection a
	)) {
		--color-link: var(--fw-color-content-link);
		--color-link--hover: var(--fw-color-content-link--hover);
		--color-link--active: var(--fw-color-content-link--active);
		--color-visited: var(--color-link);
		--color-visited--hover: var(--color-link--hover);
		--color-visited--active: var(--color-link--active);
		--color-destructive: var(--fw-color-content-link-missing);
		--color-destructive--hover: var(--fw-color-content-link-missing--hover);
		--color-destructive--active: var(--fw-color-content-link-missing--active);
		--color-destructive--visited: var(--color-destructive);
		--color-destructive--visited--hover: var(--color-destructive--hover);
		--color-destructive--visited--active: var(--color-destructive--active);
	}
}

/* Interwiki links get an external-link icon */
a.extiw::after {
	display: inline-block;
	width: 0.75em;
	height: 0.75em;
	margin-left: 0.125em;
	content: '';
	background-color: currentcolor;
	-webkit-mask: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgYXJpYS1oaWRkZW49InRydWUiIHZpZXdCb3g9IjAgMCAyMCAyMCI+IDxnIGZpbGw9ImN1cnJlbnRDb2xvciI+IDxwYXRoIGQ9Ik0xNyAxN0gzVjNoNVYxSDNhMiAyIDAgMCAwLTIgMnYxNGEyIDIgMCAwIDAgMiAyaDE0YTIgMiAwIDAgMCAyLTJ2LTVoLTJ6Ii8+IDxwYXRoIGQ9Im0xMSAxIDMuMjkgMy4yOS01LjczIDUuNzMgMS40MiAxLjQyIDUuNzMtNS43M0wxOSA5VjF6Ii8+IDwvZz4gPC9zdmc+) no-repeat 50% 50%;
	mask: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgYXJpYS1oaWRkZW49InRydWUiIHZpZXdCb3g9IjAgMCAyMCAyMCI+IDxnIGZpbGw9ImN1cnJlbnRDb2xvciI+IDxwYXRoIGQ9Ik0xNyAxN0gzVjNoNVYxSDNhMiAyIDAgMCAwLTIgMnYxNGEyIDIgMCAwIDAgMiAyaDE0YTIgMiAwIDAgMCAyLTJ2LTVoLTJ6Ii8+IDxwYXRoIGQ9Im0xMSAxIDMuMjkgMy4yOS01LjczIDUuNzMgMS40MiAxLjQyIDUuNzMtNS43M0wxOSA5VjF6Ii8+IDwvZz4gPC9zdmc+) no-repeat 50% 50%;
	-webkit-mask-size: contain;
	mask-size: contain;
}

/**
 * Main page header ({{Main page/header}})
 */
.fw-mainpage-header {
	position: relative;
	margin-top: -2rem;
	margin-bottom: -4rem;
	padding-top: 6rem;
	padding-bottom: 6rem;
	clear: both;
	overflow: hidden; /* The rotating inscription must not enlarge the element */
	pointer-events: none; /* Let clicks through the decorative overlay */
}

/* Rotating circular inscription */
.fw-mainpage-header::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: url(/images/f/ff/Theme_main_page_ring_inscription.svg);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.1;
	filter: var(--filter-invert);
	animation: fw-spin 60s infinite linear;
	pointer-events: none;
}

.fw-mainpage-content {
	align-items: center;
	display: flex;
	flex-direction: column;
	text-align: center;
	pointer-events: auto;
	position: relative;
}

/* Silhouette above the wordmark */
.fw-mainpage-header-wordmark::before {
	content: '';
	position: absolute;
	pointer-events: none;
	left: 0;
	right: 0;
	top: -100%;
	margin: 0 auto;
	width: 50%;
	height: 100%;
	background-image: url(/images/6/6c/Theme_main_page_silhouette.svg);
	background-repeat: no-repeat;
	background-position: bottom center;
	opacity: 0.2;
	filter: var(--filter-invert);
}

.fw-mainpage-header-wordmark {
	position: relative;
	margin-top: 2.5rem;
	width: 420px;
	max-width: 100%;
	padding-top: 0.75rem;
}

.fw-mainpage-header-wordmark img {
	width: 100%;
	height: 100%;
	filter: var(--fw-filter-wordmark);
}

.fw-mainpage-header-tagline {
	margin-top: 0.375rem;
	color: var(--fw-color-subtle);
	font-size: 0.875rem;
	line-height: 1.375;
}

.fw-mainpage-header-search {
	align-items: center;
	background-color: var(--fw-background-color-progressive);
	border-radius: 9999px;
	color: var(--fw-color-inverted-progressive);
	cursor: pointer;
	display: flex;
	font-size: 0.875rem;
	font-weight: var(--font-weight-medium);
	gap: 0.5rem;
	line-height: 1;
	margin-top: 1rem;
	padding: 1rem 2rem;
	user-select: none;
}

.fw-mainpage-header-search::before {
	content: '';
	width: 1rem;
	height: 1rem;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M12.2 13.6a7 7 0 1 1 1.4-1.4l5.4 5.4-1.4 1.4zM3 8a5 5 0 1 0 10 0A5 5 0 0 0 3 8'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M12.2 13.6a7 7 0 1 1 1.4-1.4l5.4 5.4-1.4 1.4zM3 8a5 5 0 1 0 10 0A5 5 0 0 0 3 8'/%3E%3C/svg%3E");
	mask-size: contain;
	-webkit-mask-size: contain;
	background-color: currentColor;
	display: block;
}

/* Keyboard shortcut hint */
@media (hover: hover) {
	.fw-mainpage-header-search::after {
		content: '/';
		margin-top: -2px;
		margin-bottom: -2px;
		margin-left: 2px;
		width: 18px;
		height: 18px;
		display: flex;
		background-color: var(--fw-color-inverted-progressive);
		color: var(--fw-background-color-progressive);
		border-radius: 4px;
		line-height: 1;
		align-items: center;
		justify-content: center;
		font-size: 10px;
		font-weight: 900;
		opacity: 0.6;
	}
}

.fw-mainpage-header-search:hover {
	background-color: var(--fw-background-color-progressive--hover);
}

.fw-mainpage-header-search:active {
	background-color: var(--fw-background-color-progressive--active);
}

@keyframes fw-spin {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}