1 /* stylelint-disable selector-class-pattern */
2 @import 'mediawiki.mixins.less';
3 @import 'mediawiki.skin.variables.less';
4 @import 'content.variables.less';
6 @margin-horizontal-image: 3px;
7 @border-width-image: 1px;
9 figure[ typeof~='mw:File/Thumb' ],
10 figure[ typeof~='mw:File/Frame' ] {
11 border: @border-subtle;
12 border-bottom: 0; // No border to figcaption
13 background-color: @background-color-interactive-subtle;
15 > :not( figcaption ) .mw-file-element {
16 border: @border-subtle;
20 border: @border-subtle;
22 background-color: @background-color-interactive-subtle;
24 /* In mw-core the font-size is duplicated, 94% in thumbinner
25 * and again 94% in thumbcaption. 88.4% for font size of the
26 * caption results in the same behavior. */
27 font-size: 88.4%; // @font-size-thumbinner-screen * @font-size-thumbcaption-screen
31 .mw-image-border .mw-file-element {
32 border: @border-width-base @border-style-base #eaecf0;
35 figure[ typeof~='mw:File/Thumb' ] {
36 > figcaption::before {
41 .margin-inline( @margin-horizontal-image, 0 );
43 // Default where page content language is not set
47 // Defaults for page content language
59 body.skin--responsive & {
60 /** Disable magnifying glass at lower resolutions */
61 @media all and ( max-width: @max-width-breakpoint-mobile ) {
67 > .mw-file-description,
79 // Default where page content language is not set
82 background-image: @background-image-magnify-ltr;
84 // Defaults for page content language
92 background-image: @background-image-magnify-ltr;
101 background-image: @background-image-magnify-rtl;
104 /** Disable magnifying glass at lower resolutions to maximize space for caption. */
105 @media all and ( max-width: @max-width-breakpoint-mobile ) {
106 /* stylelint-disable-next-line declaration-no-important */
107 background-image: none !important;
114 * RESPONSIVE IMAGES FOR RESPONSIVE SKINS (T113101 and T367463)
115 * Note we restrict to img's to avoid conflicts with VisualEditor shields.
116 * Note this currently doesn't apply to frameless images (tracked in T367831) and
117 * does not currently apply to responsive images in MobileFrontend.
119 body.skin--responsive .mw-parser-output {
120 // Only block images should be responsive to prevent 0 sizing in tables
121 // Inline images do not use figure. We do not target audio and video or other content
122 // We target .mw-file-element, as there can be img inside captions...
123 figure img.mw-file-element {
124 // Note height auto is required and only applied to images.
126 // make sure that images in articles don't cause a horizontal scrollbar
128 max-width: @size-full;
131 // Note: If the image is a thumbnail, max-width also needs to take into account margin and border.
132 figure[ typeof~='mw:File/Thumb' ] img.mw-file-element,
133 figure[ typeof~='mw:File/Frame' ] img.mw-file-element {
134 max-width: calc( @size-full - ( 2 * @margin-horizontal-image ) - ( 2 * @border-width-image ) );
138 * When the noresize class is used e.g. on a panorama or image map
139 * with clickable regions (T22030), do not subject the image to a max-width rule.
141 * [[File:example.jpg|thumb|class=noresize]] and imagemap extension put the class on figure itself (T368034)
145 img.mw-file-element {