Debian Codegraph @

resources/src/mediawiki.skinning/elements.less

raw
1 /**
2 * MediaWiki style sheet for general styles on basic content elements.
3 * IMPORTANT: All rules in this file should only apply to __tag__ selectors (T255717).
4 * Styling of non-tag selectors is permitted for backwards compatibility, in only two cases:
5 * 1) There is an equivalent tag with the same name in HTML4 (e.g. `.small and <small>)
6 * 2) A class matches a tag name and is prefixed with `mw-` e.g. `code` and `.mw-code`
7 *
8 * Styles for basic elements: links, headings, lists, ….
9 *
10 * This style sheet is used by the Monobook and Vector skins.
11 */
12
13 @import 'mediawiki.mixins.less';
14 @import 'mediawiki.skin.variables.less';
15
16 /* stylelint-disable selector-class-pattern */
17
18 /* Links */
19 a {
20 text-decoration: none;
21 color: @color-link;
22 background: none;
23
24 &:not( [ href ] ) {
25 cursor: pointer; /* Always cursor:pointer even without href */
26 }
27
28 &:visited {
29 color: @color-link--visited;
30 }
31
32 &:active {
33 color: @color-link--active;
34 }
35
36 &:hover,
37 &:focus {
38 text-decoration: underline;
39 }
40 }
41
42 /* Inline Elements */
43 img {
44 border: 0; /* FIXME: Remove after adding 'normalize.less' added to all 'elements.less' calling skins. */
45 vertical-align: middle;
46 }
47
48 hr {
49 // Use `@border-width-base` instead of `1px` to match the default border width.
50 height: @border-width-base;
51 // Use `@border-color-base` as the element represents a border.
52 background-color: @border-color-base;
53 border: 0;
54 margin: 0.2em 0;
55 }
56
57 /* Structural Elements */
58 .mw-heading,
59 h1,
60 h2,
61 h3,
62 h4,
63 h5,
64 h6 {
65 color: @color-emphasized;
66 font-weight: bold;
67 margin: 0;
68 padding-top: 0.5em;
69 padding-bottom: 0.17em;
70 // Create a "block formatting context" so that the bottom border on headings
71 // don't overlap floated content like infoboxes or thumbnails.
72 // In addition, word-break:break-word forces heading to span multiple lines.
73 // Together, these two rules are a substitute for overflow: hidden.
74 // https://developer.mozilla.org/en-US/docs/Web/CSS/display#flow-root
75 display: flow-root;
76 word-break: break-word;
77 }
78
79 .mw-heading1,
80 h1,
81 .mw-heading2,
82 h2 {
83 margin-bottom: 0.6em;
84 border-bottom: @border-width-base @border-style-base @border-color-base;
85 }
86
87 .mw-heading3,
88 h3,
89 .mw-heading4,
90 h4,
91 .mw-heading5,
92 h5 {
93 margin-bottom: 0.3em;
94 }
95
96 .mw-heading1,
97 h1 {
98 font-size: 188%;
99 font-weight: normal;
100 }
101
102 .mw-heading2,
103 h2 {
104 font-size: 150%;
105 font-weight: normal;
106 }
107
108 .mw-heading3,
109 h3 {
110 font-size: 128%;
111 }
112
113 .mw-heading4,
114 h4 {
115 font-size: 116%;
116 }
117
118 .mw-heading5,
119 h5 {
120 font-size: 108%;
121 }
122
123 .mw-heading6,
124 h6 {
125 font-size: 100%;
126 }
127
128 // Override all styles above for `hN` nested inside `.mw-heading`, as used on wikitext pages.
129 // Also override the most common skin-defined styles to make the migration after T13555 easier.
130 .mw-heading {
131 h1,
132 h2,
133 h3,
134 h4,
135 h5,
136 h6 {
137 // Must be inline to allow `.mw-editsection` to be shown on the same line
138 display: inline;
139 border: 0;
140 margin: 0;
141 padding: 0;
142 color: inherit;
143 font: inherit;
144 }
145 }
146
147 p {
148 margin: 0.4em 0 0.5em 0;
149
150 img {
151 margin: 0;
152 }
153 }
154
155 ul {
156 margin-top: 0.3em;
157 margin-bottom: 0;
158 .margin-inline( 1.6em, 0 );
159 padding: 0;
160 }
161
162 ol {
163 margin-top: 0.3em;
164 margin-bottom: 0;
165 .margin-inline( 3.2em, 0 );
166 padding: 0;
167 list-style-image: none;
168 }
169
170 dd {
171 margin-bottom: 0.1em;
172 .margin-inline( 1.6em, 0 );
173 }
174
175 li {
176 margin-bottom: 0.1em;
177 }
178
179 dt {
180 font-weight: bold;
181 margin-bottom: 0.1em;
182 }
183
184 dl {
185 margin-top: 0.2em;
186 margin-bottom: 0.5em;
187 }
188
189 /* FIXME: Duplicated ruleset if skins using ResourceLoaderSkinModule
190 load the features `normalize` and `elements`. */
191 pre,
192 code,
193 tt,
194 kbd,
195 samp,
196 .mw-code {
197 /* Support: Blink, Gecko, Webkit; enable unified font sizes for monospace font. T176636 */
198 font-family: monospace, monospace;
199 }
200
201 pre,
202 code,
203 .mw-code {
204 background-color: @background-color-neutral-subtle;
205 color: @color-emphasized;
206 border: @border-width-base @border-style-base @border-color-muted;
207 }
208
209 code {
210 border-radius: @border-radius-base;
211 padding: 1px 4px;
212 }
213
214 pre,
215 .mw-code {
216 padding: 1em;
217 /* Wrap lines in overflow. T2260, T103780 */
218 white-space: pre-wrap;
219 /* Create a new block formatting context */
220 overflow-x: hidden;
221 /* Break really long words when they overflow to the next line */
222 word-wrap: break-word;
223 }
224
225 /* Tables */
226 table {
227 font-size: 100%;
228 }
229
230 /* Forms */
231 fieldset {
232 border: @border-width-base @border-style-base #2a4b8d;
233 margin: 1em 0 1em 0;
234 padding: 0 1em 1em;
235 }
236
237 legend {
238 padding: 0.5em;
239 }
240
241 form {
242 border: 0;
243 margin: 0;
244 }
245
246 textarea {
247 display: block;
248 box-sizing: @box-sizing-base;
249 width: 100%;
250 /* Support: Firefox */
251 /* Border rule required to override system appearance on Linux. T13641. */
252 border: @border-width-base @border-style-base @border-color-base;
253 padding: 0.1em;
254 }
255
256 /* Emulate Center */
257 .center {
258 width: 100%;
259 text-align: center;
260 }
261
262 *.center * {
263 margin-left: auto;
264 margin-right: auto;
265 }
266
267 /* Small for tables and similar */
268 .small {
269 font-size: 94%;
270
271 table& {
272 font-size: 100%;
273 }
274 }