/** * Redefinition of the mw-ui-icon class from MediaWiki-core. * * This module attempts to maintain compatibility with the * core mw-ui-icon module, while adding more mobile-friendly * features like increased touch-area sizes and highlights. * * - mw-ui-icon = base class. 20px square with icon. * - mw-ui-icon + mw-ui-icon-element = icon with padding & pseudo-states. * - mw-ui-icon + mw-ui-icon-small = small icon with padding & pseudo-states. * - mw-ui-icon + mw-ui-icon-flush-left = negative right-margin. * - mw-ui-icon + mw-ui-icon-flush-right = negative left-margin. * - mw-ui-icon + mw-ui-icon-before = *deprecated*, icon with text. * Labels should be placed in a separate element beside the icon. * */ @import '../../minerva.less/minerva.variables.less'; @import 'mediawiki.mixins.less'; @icon-background-color--selected: rgba( 0, 0, 0, 0.03 ); /** * Mixin for a pseudo-element with a background image. */ .mixin-background-square( @size ) { // Sizing properties content: ''; display: block; width: 100%; height: 100%; // In case display: block is overridden and display gets set to `flex` // because of inheritance T233521. min-width: @size; min-height: @size; // Background properties. background-repeat: no-repeat; // Using static value instead of `background-size: contain` because of T233521#5545513. background-size: @size @size; background-position: center; } /** * A standalone 20px square with screen-reader text. Contains a :before element * to house the icon as a background image. Total size is increased with padding via * `box-sizing: content-box`. This separates control over size of icon vs the size of * the touch-area. */ .mw-ui-icon { // reset font-size so the "em" value is relative to the more // predictable rem font size ...and no rems because we can't have nice things. font-size: initial; // sizing position: relative; display: inline-block; // this is important for increasing the size via padding. Overrides `.view-border-box *`. box-sizing: content-box !important; width: @icon-size-md; height: @icon-size-md; // Guarding against flex-box variability. min-width: @icon-size-md; min-height: @icon-size-md; flex-basis: @icon-size-md; // alignment vertical-align: middle; line-height: 0; // Overflow ellipsis. .text-overflow( @visible: false ); // resetting styles for