Localisation updates from https://translatewiki.net.
[mediawiki.git] / resources / src / mediawiki.page.gallery.styles / gallery.less
blobc7c2ca40fcd2340c568a286b69ac5391deb69807
1 @import 'mediawiki.skin.variables.less';
3 /* stylelint-disable selector-class-pattern */
5 /* Galleries */
6 /* Don't forget to update gallery.print.css */
8 // Increase specificity to override `.mw-content-rtl .mw-content-ltr ul` (T326017)
9 // TODO: Galleries should not use `<ul>` (T38755)
10 ul.gallery.gallery.gallery {
11         margin: 2px;
12         padding: 2px;
13         display: block;
16 li.gallerycaption {
17         font-weight: bold;
18         text-align: center;
19         display: block;
20         word-wrap: break-word;
23 li.gallerybox {
24         vertical-align: top;
25         display: inline-block;
27         div.thumb {
28                 text-align: center;
29                 margin: 2px;
31                 img {
32                         display: block;
33                         margin: 0 auto;
34                 }
35         }
38 div.gallerytext {
39         overflow: hidden;
40         font-size: 94%;
41         padding: 9px 4px 17px;
42         word-wrap: break-word;
44         // FIXME: This is for backwards compatibility with parser markup generated prior
45         // to I5039c7ef9e07199c256fd568b4f94714e5831d17. It can be removed when we no longer
46         // need to worry about that HTML.
47         p {
48                 margin: 0;
49         }
52 .galleryfilename {
53         display: block;
55         &-truncate {
56                 white-space: nowrap;
57                 overflow: hidden;
58                 text-overflow: ellipsis;
59         }
62 /* new gallery stuff */
63 ul.mw-gallery-nolines li.gallerybox {
64         div.thumb {
65                 background-color: transparent;
66                 border: 0;
67         }
69         div.gallerytext {
70                 text-align: center;
71         }
74 /* height constrained gallery */
76 ul.mw-gallery-packed,
77 ul.mw-gallery-packed-overlay,
78 ul.mw-gallery-packed-hover {
79         text-align: center;
81         li.gallerybox div.thumb {
82                 background-color: transparent;
83                 border: 0;
85                 img {
86                         margin: 0 auto;
87                 }
88         }
91 ul.mw-gallery-packed-hover,
92 ul.mw-gallery-packed-overlay {
93         li.gallerybox {
94                 position: relative;
95         }
98 ul.mw-gallery-packed-hover div.gallerytextwrapper {
99         overflow: hidden;
100         height: 0;
103 ul.mw-gallery-packed-hover li.gallerybox:hover div.gallerytextwrapper,
104 ul.mw-gallery-packed-overlay li.gallerybox div.gallerytextwrapper,
105 ul.mw-gallery-packed-hover li.gallerybox.mw-gallery-focused div.gallerytextwrapper {
106         position: absolute;
107         background: @background-color-backdrop-light;
108         padding: 5px 10px;
109         bottom: 0;
110         left: 0; /* Needed for IE */
111         height: auto;
112         max-height: 40%;
113         overflow: hidden;
114         font-weight: bold;
115         margin: 2px; /* correspond to style on div.thumb */
117         p {
118                 text-overflow: ellipsis;
119                 white-space: nowrap;
120                 overflow: hidden;
121         }
123         &:hover {
124                 overflow: visible;
125                 max-height: none;
127                 p {
128                         text-overflow: clip;
129                         white-space: normal;
130                         overflow: visible;
131                 }
132         }
135 /* Slideshow */
136 // Increase specificity to override `.mw-content-rtl .mw-content-ltr ul` (T326017)
137 // TODO: Galleries should not use `<ul>` (T38755)
138 ul.gallery.gallery.gallery.mw-gallery-slideshow {
139         display: block;
140         margin: 4em 0;
143 .mw-gallery-slideshow {
144         .gallerycaption {
145                 font-size: 1.3em;
146                 margin: 0;
147         }
149         /* `li` item */
150         .gallerycarousel {
151                 display: block;
152                 text-align: center;
154                 &.mw-gallery-slideshow-thumbnails-toggled {
155                         margin-bottom: 1.3em;
156                 }
157         }
159         .mw-gallery-slideshow-buttons {
160                 opacity: 0.5;
161                 padding: 1.3em 0;
162                 white-space: nowrap;
164                 .oo-ui-buttonElement {
165                         margin: 0 2em;
167                         &:first-child {
168                                 margin-left: 0;
169                         }
171                         &:last-child {
172                                 margin-right: 0;
173                         }
174                 }
175         }
177         .gallerybox {
178                 &.slideshow-current {
179                         background: @background-color-interactive;
180                 }
182                 > div {
183                         max-width: 120px;
184                 }
186                 div.thumb {
187                         border: 0;
188                         background: transparent;
189                 }
190         }
193 .mw-gallery-slideshow-img-container a {
194         display: block;
197 @media screen {
198         /* Background and border colors are defined separately for print mode */
199         li.gallerybox div.thumb {
200                 background-color: @background-color-neutral-subtle;
201                 border: @border-subtle;
202         }