MediaWiki:Gadget-StickyTableHeaders.css

MediaWiki系统消息页面
/* <nowiki> */
/**
 * SPDX-License-Identifier: CC-BY-SA-4.0
 * _addText: '{{Gadget Header|license=CC-BY-SA-4.0}}'
 *
 * @source <en.wikipedia.org/wiki/MediaWiki:Gadget-StickyTableHeaders.csss>
 */
/**
 * sortable tables and JS enhanced wikitables with thead, works with Safari. This is ideal.
 * But borders are broken: <bugs.webkit.org/show_bug.cgi?id=128486>
 */
.jquery-tablesorter > thead,
.mw-sticky-header > thead {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
}

/* This does not seem to work, possibly due to the absolute/relative hacking mess of gongbi */
@media screen and (max-width: 1099px) and (min-width: 851px) {
	.skin-gongbi .jquery-tablesorter > thead,
	.skin-gongbi .mw-sticky-header > thead {
		top: 3.125em;
	}
}

@media screen and (min-width: 1100px) {
	.skin-gongbi .jquery-tablesorter > thead,
	.skin-gongbi .mw-sticky-header > thead {
		top: 6em;
	}
}

@media screen and (min-width: 1000px) {
	.skin-vector-2022.vector-sticky-header-visible .jquery-tablesorter > thead,
	.skin-vector-2022.vector-sticky-header-visible .mw-sticky-header > thead {
		top: 3.125rem;
	}
}

.jquery-tablesorter > tfoot,
.mw-sticky-header > tfoot {
	position: -webkit-sticky;
	position: sticky;
	bottom: 0;
}
/**
 * On mobile, where we have tables in overflowable boxes to avoid viewport overflows,
 * by using display:block, sticky never works though :(
 */

/* </nowiki> */