resources/src/mediawiki.skinning/content.body.less
/* stylelint-disable selector-class-pattern */

/**
 * NOTE: This feature is enabled for all skins. Please read the instructions below before adding anything
 * new to this file.
 *
 * This feature provides various styles associated with the body content of an article.
 * The article body is considered to be anything that can be generated by OutputPage::getHTML()
 * that is (or could be considered) universal to all pages in the main namespace.
 *
 * It is expected that this HTML is wrapped by SkinTemplate::wrapHTML and that the wrapping
 * element makes use of the `mw-body-content` class.
 *
 * All styles here should be be scoped to the `.mw-body-content` or one of its child class
 * e.g. `mw-parser-output class` where more appropriate.
 *
 * Styles here should be limited to CSS classes generated by PHP code inside MediaWiki core.
 * Classes added that require an on-wiki template in the Template space and cannot be reproduced
 * with a vanilla MediaWiki install are not allowed here. Please use MediaWiki:Common.css and
 * MediaWiki:<skin>.css for such styles.
 */
@import 'mediawiki.skin.variables.less';
@import 'mediawiki.mixins.less';

/**
 * It's possible to add HTML elements inside wikitext, for example <div style="float:right;"></div>
 * Editors have grown to expect that any floated elements added inside wikitext will be cleared
 * automatically by the skin. This rule encapsulates that user expectation in a central place that
 * applies to all skins.
 * Note, this applies to mw-body-content not mw-parser-output as on pages such as the category page,
 * the body of a page includes other sibling elements aside from the output of the parser.
 */
.mw-body-content {
	.mixin-clearfix();

	a.external.free {
		word-wrap: break-word;
	}

	// error is a class outputted by the parser,
	// when transcluding a page on itself, for example.
	.error {
		font-size: larger;
		color: @color-error;
	}
}

/* External URLs should always be treated as LTR (T6330) */
/* @noflip */ .rtl .mw-parser-output a.external.free,
.rtl .mw-parser-output a.external.autonumber {
	direction: ltr;
	unicode-bidi: embed;
}

// Hide elements that are marked as "empty" according to legacy Tidy rules,
// except if a client script removes the `.mw-hide-empty-elt` class from the body.
// Allow individual parser-output blocks to show empty elements using `.mw-show-empty-elt`,
// for example an editing interface. (T295984)
/* body */ .mw-hide-empty-elt .mw-parser-output:not( .mw-show-empty-elt ) .mw-empty-elt {
	display: none;
}
