resources/src/mediawiki.skinning/content.tables.less
/**
 * wikitable class for skinning normal tables.
 * Keep in sync with content.tables-print.less.
 */

/* stylelint-disable selector-class-pattern */

@import 'mediawiki.skin.variables.less';

@media all and ( max-width: @max-width-breakpoint-mobile ) {
	// T330527
	.mw-parser-output {
		table {
			display: block;
			overflow: auto;
			max-width: 100%;
			width: fit-content;
		}

		/**
		 * Disable the above behaviour when noresize is present.
		 * See mediawiki.skinning/interface for more information.
		 */
		.noresize table {
			display: table;
		}
	}
}

.wikitable {
	background-color: @background-color-neutral-subtle;
	color: @color-base;
	margin: 1em 0;
	border: @border-width-base @border-style-base @border-color-base;
	border-collapse: collapse;

	> tr > th,
	> tr > td,
	> * > tr > th,
	> * > tr > td {
		border: @border-width-base @border-style-base @border-color-base;
		padding: 0.2em 0.4em;
	}

	> tr > th,
	> * > tr > th {
		background-color: @background-color-neutral;
		color: @color-base;
		text-align: center;
	}

	> caption {
		font-weight: bold;
	}

	@media all and ( max-width: @max-width-breakpoint-mobile ) {
		body.skin--responsive & {
			float: none;
			margin-left: 0;
			margin-right: 0;
		}
	}
}
