Debian Codegraph @

skins/MinervaNeue/resources/skins.minerva.base.styles/ui.less

raw
1 @import '../../minerva.less/minerva.variables.less';
2 @import '../../minerva.less/minerva.mixins.less';
3 @import 'mediawiki.mixins.less';
4 @import 'icons.less';
5
6 /* stylelint-disable no-descending-specificity */
7 html,
8 body {
9 // Ensure overlays take up full screen
10 height: 100%;
11 }
12
13 html {
14 font-size: @font-size-root;
15 // Support Safari: Prevent font scaling in landscape
16 -webkit-text-size-adjust: none;
17 }
18
19 body {
20 background-color: @background-color-base;
21 color: @color-base;
22 // Support All Browsers: Remove `margin` (normalized)
23 margin: 0;
24 }
25
26 /* needed for navigation elements and content */
27 ul {
28 margin: 0;
29 padding: 0;
30 }
31
32 main {
33 // Support IE 9-11: Apply correct `display` (normalized), see T207618.
34 display: block;
35 }
36
37 .mw-body {
38 // avoid margin collapsing (see T147956)
39 border-top: @border-width-base @border-style-base @border-color-transparent;
40 padding-bottom: 32px;
41 }
42
43 .overlay-enabled,
44 .mw-body {
45 background-color: @background-color-base;
46 }
47
48 // If footer has last modified list item (Desktop MinervaNeue ?useformat=desktop&useskin=minerva),
49 // hide it (T173545).
50 // stylelint-disable-next-line selector-max-id
51 .navigation-drawer--loading,
52 #footer-info-lastmod {
53 display: none;
54 }
55
56 // Override rule in MobileFrontend (
57 // (ul.footer-info li in resources/mobile.init.styles.less)
58 // to show copyright.
59 // stylelint-disable-next-line selector-max-id
60 #footer-info-copyright {
61 display: block;
62 }
63
64 // JavaScript overlay and server side rendered header
65 .overlay-header,
66 .minerva-header {
67 display: flex;
68 align-items: center;
69 width: 100%;
70 border-spacing: 0;
71 border-collapse: collapse;
72 height: @height-site-header;
73 white-space: nowrap;
74 // When banners are present we want to easily distinguish between them and the header so add border
75 border-top: @border-subtle;
76 // Hide the header border top when a banner is not present.
77 margin-top: -@border-width-base;
78 }
79
80 //
81 // Search
82 //
83 .minerva-search-form {
84 display: flex;
85 width: 100%;
86 flex-grow: 1;
87 align-items: center;
88
89 > button {
90 margin-left: auto;
91 }
92 }
93
94 .search-box {
95 position: relative;
96 }
97
98 // Search input
99 // Used in minerva header and search overlay header
100 .search-box .search {
101 @size-icon-search: unit( 18 / @font-size-browser, em );
102 @size-icon-search-gutter: unit( 8 / @font-size-browser, em );
103 @size-modifier-border: unit( 1 / @font-size-browser, em );
104 @padding-vertical-search: 8px - @border-width-base;
105 @padding-start-search-icon: @size-icon-search + ( 2 * @size-icon-search-gutter ) - @size-modifier-border;
106 background-color: @background-color-base; // Support Fennec, Opera Mini: Remove default background, see T38490.
107 // Support Safari: Get rid of rounded corners.
108 -webkit-appearance: none;
109 width: 100%;
110 margin: 0;
111 height: 2.25em;
112 border: @border-width-base @border-style-base @border-color-inverted;
113 border-radius: @border-radius-base;
114 padding: @padding-vertical-search 0 @padding-vertical-search @padding-start-search-icon;
115 box-shadow: @box-shadow-drop-small;
116 // Keyboard focus is taken care of below at `.search:focus`.
117 outline: 0;
118 transition-property: border-color, box-shadow;
119 transition-duration: @transition-duration-medium;
120 font: inherit;
121 // Disable search background for cached HTML.
122 mask-image: none;
123
124 // [T139928] Hide all pseudo-elements added to search inputs in WebKit.
125 &::-webkit-search-decoration,
126 &::-webkit-search-cancel-button,
127 &::-webkit-search-results-button,
128 &::-webkit-search-results-decoration {
129 display: none;
130 }
131 }
132
133 .search-box-icon-overlay {
134 position: absolute;
135 display: flex;
136 align-items: center;
137 left: 8px;
138 top: 0;
139 bottom: 0;
140 }
141
142 // Provide focus styles only in non-JS and overlay to prevent double transition.
143 .client-nojs .search-box .search:focus,
144 .search-overlay .search-box .search:focus {
145 border-color: @border-color-progressive--focus;
146 box-shadow: @box-shadow-inset-small @box-shadow-color-progressive--focus, 0 1px 1px rgba( 0, 0, 0, 0.05 );
147 }
148
149 .content {
150 .mw-heading2,
151 h2 {
152 // Clear table of contents and any other floated elements in desktop Minerva.
153 clear: left;
154 }
155
156 // Only reveal section edit links in expanded section headings.
157 // The .section-heading class is only present on mobile.
158 .section-heading {
159 .mw-editsection {
160 visibility: hidden;
161 }
162
163 &.open-block .mw-editsection,
164 .client-nojs & .mw-editsection {
165 visibility: visible;
166 }
167 }
168
169 /* For legacy parser */
170 .mw-parser-output > .mw-heading2,
171 .mw-parser-output > h2,
172 .mw-parser-output[ data-mw-parsoid-version ] > section > .mw-heading2,
173 .section-heading {
174 border-bottom: @border-width-base @border-style-base @border-color-muted;
175 margin-bottom: @margin-heading;
176 }
177
178 .mw-parser-output {
179 // We want to apply display: flex to the heading wrapper elements to style them right (T305971),
180 // but not to the heading text elements, because it results in bad text layout (T367468).
181 // This turns out to be difficult, because mobile/desktop, legacy/modern/unwrapped headings,
182 // and DiscussionTools/normal page generate a lot of different combinations of HTML markup.
183
184 // Support modern headings, DiscussionTools, and mobile mode
185 .mw-heading,
186 .section-heading {
187 display: flex;
188 // T356513: display after floated elements
189 min-width: fit-content;
190 }
191
192 // Support desktop Minerva legacy headings (this can only be done with a :has() selector,
193 // there's no other way to distinguish them from unwrapped headings, even though it lacks
194 // support for some browsers). Will be no longer needed when legacy headings are gone.
195 // FIXME: Remove this block when $wgParserEnableLegacyHeadingDOM is removed.
196 :is( h1, h2, h3, h4, h5, h6 ):has( .mw-headline ) {
197 display: flex;
198 }
199
200 // FIXME: Remove `.mw-headline` when $wgParserEnableLegacyHeadingDOM is removed.
201 h1,
202 h2,
203 h3,
204 h4,
205 h5,
206 h6,
207 .mw-headline {
208 flex-grow: 1;
209 flex-basis: 0;
210 margin-left: 0;
211 }
212
213 .mw-editsection {
214 align-self: center;
215 // Negative margins to prevent the edit icon from affecting the height of the heading
216 margin-top: -1em;
217 margin-bottom: -1em;
218 .cdx-mixin-button-layout-flush( 'end', true, 'large' );
219
220 .cdx-button {
221 font-size: 1rem;
222 }
223 }
224 }
225 }
226
227 // stylelint-disable selector-max-id
228 #page-secondary-actions {
229 a {
230 margin: 10px 2px 2px 0;
231 }
232 }
233
234 // It may be better to express these in a single class
235 // or think about using extend or a mixin to stay with semantic selectors
236 // https://css-tricks.com/the-extend-concept/
237 #bodyContent .panel .content,
238 .overlay .content-header,
239 .overlay .panel,
240 .mw-mf-page-list.side-list .list-thumb,
241 .mw-mf-page-list li,
242 .topic-title-list li,
243 .site-link-list li,
244 .drawer,
245 /*Specificity needed to override content styles in core. */
246 .content h2.list-header,
247 .list-header,
248 .mw-revision {
249 padding-left: @padding-content;
250 padding-right: @padding-content;
251 }
252
253 .image-list,
254 .minerva-anon-talk-message,
255 .pre-content,
256 /* Form only pages e.g Special:MobileOptions */
257 #mw-content-text > form > .oo-ui-fieldLayout > .oo-ui-fieldLayout-body,
258 /* Save button on Special:MobileOptions */
259 #mw-content-text > form > .oo-ui-widget,
260 .content,
261 .post-content {
262 margin: 0 @margin-content;
263 }
264
265 // T217197
266 #mw-content-subtitle {
267 margin-top: 10px;
268 margin-bottom: 10px;
269
270 &:empty {
271 margin: 0;
272 }
273 }
274 // stylelint-enable selector-max-id
275
276 @media all and ( min-width: @min-width-breakpoint-tablet ) {
277 /* FIXME: this should be one generic class name */
278 /* SpecialMobileEditWatchlist */
279 .page-summary-list,
280 /* Talk overlay */
281 .topic-title-list,
282 /* structured languages, mobile pagelists */
283 .site-link-list,
284 /* overlays */
285 .overlay .panel,
286 /* language overlay / MobileSpecialPageFeed */
287 .list-header {
288 padding-left: @padding-content-tablet;
289 padding-right: @padding-content-tablet;
290 }
291 }
292 /* stylelint-enable no-descending-specificity */